Description
user story : AS A Developer, I WANT the Authentication service to return structured user data objects upon registration and login SO THAT the frontend can immediately synchronize the application state and user interface without making an additional API call.
Details
It will be used by frontend.
Alongside #49 , it would help if auth service could return the same detailed object (without password) :
for instance for /register
return reply.code(201).send({
data: {
authId: id,
username: username,
email: email,
role: 'USER' // default
},
message: 'User registered successfully'
});
and login
reply
.setCookie('token', token, getCookieOptions(AUTH_CONFIG.COOKIE_MAX_AGE_SECONDS))
.code(200)
.send({
data: {
authId: user.id,
username: user.username,
email: user.email,
role: user.role,
},
message: `Welcome ${user.username} !`
});
Priority
high
Definition of done
- Zod validation : use or update the auth.schema in core package ?
Out of scope
Subtasks
Description
user story : AS A Developer, I WANT the Authentication service to return structured user data objects upon registration and login SO THAT the frontend can immediately synchronize the application state and user interface without making an additional API call.
Details
It will be used by frontend.
Alongside #49 , it would help if auth service could return the same detailed object (without password) :
for instance for /register
and login
Priority
high
Definition of done
Out of scope
Subtasks