Skip to content

Commit

Permalink
refactor: renames helper
Browse files Browse the repository at this point in the history
  • Loading branch information
varortz committed May 24, 2024
1 parent 92694a4 commit 1d9e50b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/api/supabase/queries/password.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import supabase from '../createClient';
* Checks if the current password is different from the current user's password
* @returns a Promise of whether the password is different
*/
export async function verifyUserPassword(password: string): Promise<boolean> {
export async function verifyNewPassword(password: string): Promise<boolean> {
const { data, error } = await supabase.rpc('verify_user_password', {
password,
});
Expand Down
4 changes: 2 additions & 2 deletions src/app/(auth)/reset-password/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { useEffect, useState } from 'react';
import { useRouter } from 'next/navigation';
import supabase from '@/api/supabase/createClient';
import { verifyUserPassword } from '@/api/supabase/queries/password';
import { verifyNewPassword } from '@/api/supabase/queries/password';
import { BigBlueButton } from '@/components/Buttons';
import PasswordComplexity from '@/components/PasswordComplexity';
import TextInput from '@/components/TextInput/index';
Expand Down Expand Up @@ -39,7 +39,7 @@ export default function ResetPassword() {
setErrorMessage('Passwords do not match.');
return;
}
if (await verifyUserPassword(newPassword)) {
if (await verifyNewPassword(newPassword)) {
setErrorMessage('New password must be different from the old password.');
return;
}
Expand Down

0 comments on commit 1d9e50b

Please sign in to comment.