Skip to content

Commit

Permalink
adding update password
Browse files Browse the repository at this point in the history
  • Loading branch information
Anas-github-acc committed Jul 29, 2024
1 parent b31e86f commit 6a22e7f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/app/auth/component/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ export function Component( props : Props) {
id="remember-me"
name="remember-me"
className="h-4 w-4 rounded text-primary focus:ring-primary"
checked
disabled
/>
<Label htmlFor="remember-me" className="ml-2 block text-sm text-foreground">
Remember me
Expand Down
1 change: 1 addition & 0 deletions src/app/auth/update_password/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default function Update_password() {
setLoading(true)
if( e.currentTarget.password.value !== e.currentTarget.confirmPassword.value ) {
setErrorMsg("Passwords do not match")
setLoading(false)
return
}
const { error } = await supabase.auth.updateUser({
Expand Down
2 changes: 1 addition & 1 deletion src/utils/supabase/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export async function updateSession(request: NextRequest) {
let { data: {user}, error} = await supabase.auth.getUser()


if (user && (request.nextUrl.pathname === '/auth/confirm_email' || request.nextUrl.pathname === '/auth')) {
if (user && (request.nextUrl.pathname === '/auth/confirm_email' || request.nextUrl.pathname === '/auth' || request.nextUrl.pathname === '/auth/reset_password')) {
response = NextResponse.redirect(new URL('/form_create', request.nextUrl.href))
} else if (!user && ( request.nextUrl.pathname === '/form_create' )) {
response = NextResponse.redirect(new URL('/auth', request.nextUrl.href))
Expand Down

0 comments on commit 6a22e7f

Please sign in to comment.