mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +00:00
Update auth.ts
This commit is contained in:
@@ -108,4 +108,20 @@ export const authApi = {
|
|||||||
const response = await apiClient.get<User>('/cabinet/auth/me');
|
const response = await apiClient.get<User>('/cabinet/auth/me');
|
||||||
return response.data;
|
return response.data;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Request email change - sends verification code to new email
|
||||||
|
requestEmailChange: async (newEmail: string): Promise<{ message: string }> => {
|
||||||
|
const response = await apiClient.post('/cabinet/auth/email/change', {
|
||||||
|
new_email: newEmail,
|
||||||
|
});
|
||||||
|
return response.data;
|
||||||
|
},
|
||||||
|
|
||||||
|
// Verify email change with code
|
||||||
|
verifyEmailChange: async (code: string): Promise<{ message: string; email: string }> => {
|
||||||
|
const response = await apiClient.post('/cabinet/auth/email/change/verify', {
|
||||||
|
code,
|
||||||
|
});
|
||||||
|
return response.data;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user