fix: allow email change for unverified emails without code verification

Skip code-based flow for unverified emails — replace email directly
and send verification to the new address. Show success step immediately
instead of asking for a verification code.
This commit is contained in:
Fringg
2026-02-11 18:28:49 +03:00
parent 1d6ec70116
commit a0b10e688c
2 changed files with 13 additions and 4 deletions

View File

@@ -110,7 +110,9 @@ export const authApi = {
},
// Request email change - sends verification code to new email
requestEmailChange: async (newEmail: string): Promise<{ message: string }> => {
requestEmailChange: async (
newEmail: string,
): Promise<{ message: string; new_email: string; expires_in_minutes: number }> => {
const response = await apiClient.post('/cabinet/auth/email/change', {
new_email: newEmail,
});