Include user information and token expiration in authentication responses
Updated the `Token` schema to include `user` data and `expires_in` field. Adjusted backend `auth_service.py` to populate these fields while generating tokens. Replaced `getCurrentUserInfo` with `getCurrentUserProfile` in the frontend and disabled ESLint for generated files to suppress warnings.
This commit is contained in:
4
frontend/src/lib/api/hooks/useAuth.ts
Normal file → Executable file
4
frontend/src/lib/api/hooks/useAuth.ts
Normal file → Executable file
@@ -15,7 +15,7 @@ import {
|
||||
register,
|
||||
logout,
|
||||
logoutAll,
|
||||
getCurrentUserInfo,
|
||||
getCurrentUserProfile,
|
||||
requestPasswordReset,
|
||||
confirmPasswordReset,
|
||||
changeCurrentUserPassword,
|
||||
@@ -55,7 +55,7 @@ export function useMe() {
|
||||
const query = useQuery({
|
||||
queryKey: authKeys.me,
|
||||
queryFn: async (): Promise<User> => {
|
||||
const response = await getCurrentUserInfo({
|
||||
const response = await getCurrentUserProfile({
|
||||
throwOnError: true,
|
||||
});
|
||||
return response.data as User;
|
||||
|
||||
Reference in New Issue
Block a user