Skip to content
Snippets Groups Projects
Commit fda57b82 authored by Louis's avatar Louis :fire:
Browse files

Also create a token to send back to the user on registration

parent c4ad99fd
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,9 @@ exports.register = async ctx => { ...@@ -19,7 +19,9 @@ exports.register = async ctx => {
const newUser = await ctx.services.userService.register(name || null, email, password, { dob: date_of_birth }) const newUser = await ctx.services.userService.register(name || null, email, password, { dob: date_of_birth })
await newUser.handleIncludes(ctx.includes) await newUser.handleIncludes(ctx.includes)
ctx.body = { user: newUser } const token = await newUser.asToken()
ctx.body = { user: newUser, token }
} }
exports.login = async ctx => { exports.login = async ctx => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment