Last active
February 5, 2020 12:58
-
-
Save patrikengborg/5a2a615ce6222ad255d0a1762bcaa52a to your computer and use it in GitHub Desktop.
This file contains 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
async login({ response, auth, request }) { | |
const { email, password } = request.all() | |
const data = await auth.attempt(email, password) | |
if (data.token) { | |
return response.cookie('token', data.token, { | |
domain: 'mydomain.com', | |
httpOnly: true, | |
secure: true, | |
sameSite: 'Lax', | |
path: '/' | |
}) | |
} | |
return data | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment