smth smth flashmessages

This commit is contained in:
Sockenklaus
2023-07-07 23:33:59 +02:00
parent ffd5d2969a
commit 6d28aaecb7
3 changed files with 61 additions and 29 deletions

View File

@@ -18,6 +18,12 @@ export default class AuthController {
}
})
session.flash({
login: {
warning: 'test'
}
})
await auth.attempt(username, password)
response.redirect().toRoute('events.index')
}
@@ -25,8 +31,11 @@ export default class AuthController {
public async logout({ auth, response, session }: HttpContextContract) {
await auth.logout()
session.flash('errors', {
logout: 'test'
session.flash('gfd', {
warning: 'test'
})
session.flash('login', {
warning: "noch eine warning"
})

View File

@@ -35,7 +35,7 @@ export default class ExceptionHandler extends HttpExceptionHandler {
* Handle failed authentication attempt
*/
if (['E_INVALID_AUTH_PASSWORD', 'E_INVALID_AUTH_UID'].includes(error.code)) {
session.flash('errors', { login: error.message });
session.flash('login', { error: error.message });
return response.redirect().back();
}