feat: standardize login response format with code, message, and data wrapper
Update login endpoint to return consistent API response structure with code, message, and data fields. Wrap token, refreshToken, and user data inside a data object to match the standardized response format used across other endpoints.
This commit is contained in:
parent
4ff57555a2
commit
d7f824f353
3 changed files with 42 additions and 30 deletions
|
|
@ -58,9 +58,13 @@ export class AuthService {
|
|||
logger.info('User logged in successfully', { userId: user.id, email: user.email });
|
||||
|
||||
return {
|
||||
token,
|
||||
refreshToken,
|
||||
user: await this.formatUserResponse(user)
|
||||
code: 200,
|
||||
message: 'Login successful',
|
||||
data: {
|
||||
token,
|
||||
refreshToken,
|
||||
user: await this.formatUserResponse(user)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue