Skip to content

Commit

Permalink
improvement: wrap auth error flash messages inside an array
Browse files Browse the repository at this point in the history
Done to be consistent with validation errors shape
  • Loading branch information
thetutlage committed Apr 30, 2020
1 parent f4c63b8 commit 05c22c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Exceptions/InvalidCredentialsException.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ export class InvalidCredentialsException extends Exception {
ctx.session.flashExcept(['_csrf'])
ctx.session.flash('auth', {
errors: {
uid: this.code === 'E_INVALID_AUTH_UID' ? 'Invalid login id' : null,
password: this.code === 'E_INVALID_AUTH_PASSWORD' ? 'Invalid password' : null,
uid: this.code === 'E_INVALID_AUTH_UID' ? ['Invalid login id'] : null,
password: this.code === 'E_INVALID_AUTH_PASSWORD' ? ['Invalid password'] : null,
},
})
ctx.response.redirect('back', true)
Expand Down

0 comments on commit 05c22c8

Please sign in to comment.