Skip to content

Commit

Permalink
+upd: await for pusher.trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
nicitaacom committed Nov 25, 2023
1 parent 87ee437 commit 80dbe00
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/(auth)/auth/callback/credentials/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export async function GET(request: Request) {
// TODO - check it - because might possible error with setting data in localstorage
// I mean it localstorage will be updated only on 'auth completed you may close this page' but not in actual first page
console.log(50, "pusherServer.trigger email - ", email)
pusherServer.trigger(email, "auth:completed", null)
await pusherServer.trigger(email, "auth:completed", null)

return NextResponse.redirect(
`${requestUrl.origin}/auth/completed?code=${code}
Expand Down
2 changes: 1 addition & 1 deletion app/api/auth/reset/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function POST(req: Request) {
}
throw new Error(error.message)
}
pusherServer.trigger(body.email, "recover:completed", null)
await pusherServer.trigger(body.email, "recover:completed", null)
return NextResponse.json({ user: data.user })
} catch (error) {
if (error instanceof Error) {
Expand Down

0 comments on commit 80dbe00

Please sign in to comment.