Skip to content

Commit

Permalink
feat: send error message in the form of json instead of string
Browse files Browse the repository at this point in the history
  • Loading branch information
pbteja1998 committed Feb 9, 2022
1 parent 5d40bba commit 5c1ce52
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export class EmailLinkStrategy<User> extends Strategy<
if (!options.failureRedirect) {
throw new Error(message)
}
session.flash(this.sessionErrorKey, message)
session.flash(this.sessionErrorKey, { message })
const cookie = await sessionStorage.commitSession(session)
throw redirect(options.failureRedirect, {
headers: { 'Set-Cookie': cookie },
Expand Down Expand Up @@ -220,7 +220,7 @@ export class EmailLinkStrategy<User> extends Strategy<
throw error
}
const { message } = error as Error
session.flash(this.sessionErrorKey, message)
session.flash(this.sessionErrorKey, { message })
const cookie = await sessionStorage.commitSession(session)
throw redirect(options.failureRedirect, {
headers: { 'Set-Cookie': cookie },
Expand All @@ -247,7 +247,7 @@ export class EmailLinkStrategy<User> extends Strategy<
throw error
}
const { message } = error as Error
session.flash(this.sessionErrorKey, message)
session.flash(this.sessionErrorKey, { message })
const cookie = await sessionStorage.commitSession(session)
throw redirect(options.failureRedirect, {
headers: { 'Set-Cookie': cookie },
Expand Down

0 comments on commit 5c1ce52

Please sign in to comment.