- added working typescript support to vue
- added bouncer support - added UserPolicies - added first user index call
This commit is contained in:
@@ -2,7 +2,7 @@ import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
|
||||
export default class AuthController {
|
||||
public async login({ auth, request, response, session }: HttpContextContract){
|
||||
public async login({ auth, request, response }: HttpContextContract){
|
||||
|
||||
|
||||
const loginSchema = schema.create({
|
||||
@@ -18,27 +18,13 @@ export default class AuthController {
|
||||
}
|
||||
})
|
||||
|
||||
session.flash({
|
||||
login: {
|
||||
warning: 'test'
|
||||
}
|
||||
})
|
||||
|
||||
await auth.attempt(username, password)
|
||||
response.redirect().toRoute('events.index')
|
||||
}
|
||||
|
||||
public async logout({ auth, response, session }: HttpContextContract) {
|
||||
public async logout({ auth, response }: HttpContextContract) {
|
||||
await auth.logout()
|
||||
|
||||
session.flash('gfd', {
|
||||
warning: 'test'
|
||||
})
|
||||
session.flash('login', {
|
||||
warning: "noch eine warning"
|
||||
})
|
||||
|
||||
|
||||
response.redirect('/login')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user