Refactor HomePage to use custom Button component; enhance login service to fetch user with full relations for improved data handling.
This commit is contained in:
@@ -37,12 +37,17 @@ export const loginService = {
|
||||
metadata
|
||||
);
|
||||
|
||||
// Получить пользователя с полными данными (филиал и компания)
|
||||
const userWithRelations = await userService.findByIdWithRelations(user.id);
|
||||
|
||||
// Вычислить дату истечения токена
|
||||
const expiresAt = new Date();
|
||||
expiresAt.setDate(expiresAt.getDate() + 7);
|
||||
|
||||
return {
|
||||
user: userService.sanitize(user),
|
||||
user: userWithRelations
|
||||
? userService.sanitizeWithRelations(userWithRelations)
|
||||
: userService.sanitize(user),
|
||||
session: {
|
||||
id: sessionId,
|
||||
token: accessToken,
|
||||
|
||||
Reference in New Issue
Block a user