Created
September 17, 2017 18:18
-
-
Save cannap/09ac6d70ee0b56aaf0df030d67a09a9b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var UserService = make('App/Services/UserService') | |
class AuthController { | |
async login ({ request, response, auth }) { | |
UserService.demo() | |
const { email, password } = request.all() | |
try { | |
const token = await auth.attempt(email, password) | |
response.send(token) | |
} catch (error) { | |
// | |
// | |
console.log(error) | |
response.unauthorized('Login nicht möglich') | |
} | |
} | |
} | |
module.exports = AuthController |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment