Skip to content

Commit

Permalink
Fix forgot password
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay9874 committed Jan 8, 2024
1 parent c576869 commit c3fbc42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions frontend/src/api/store/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,13 @@ export const authStore = create((set, get) => ({
}
},
recoverUser: async (email, navigate) => {
const { data, error } = await supabase.auth.resetPasswordForEmail(email)
const { data, error } = await supabase.auth.resetPasswordForEmail(email, {
redirectTo: 'https://nrega-2-0-git-auth-jay9874.vercel.app/api/recovery'
})
if (error) {
console.log(error)
return toast.error(error.message)
} else {
console.log(data)
toast.success('Recovery email sent!', { duration: 750 })
navigate('/')
return null
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ app.get('/api/hello', (req, res) => {
})

app.get('/api/recovery', (req, res) => {
res.send(req)
res.send('Hello')
})

app.get('*', (req, res) => {
Expand Down

0 comments on commit c3fbc42

Please sign in to comment.