add cooldown notification repeat

This commit is contained in:
lendry
2026-06-25 14:45:01 +03:00
parent 6c63343fc7
commit 9671fe458b
11 changed files with 173 additions and 25 deletions

View File

@@ -35,7 +35,7 @@ interface AuthContextValue {
hasStoredSession: boolean;
login: (login: string, password: string) => Promise<AuthTokens>;
identifyLogin: (login: string) => Promise<IdentifyResponse>;
sendLoginOtp: (recipient: string, channel?: string) => Promise<string>;
sendLoginOtp: (recipient: string, channel?: string) => Promise<OtpSendResponse>;
verifyLoginOtp: (recipient: string, code: string) => Promise<PasswordlessAuthResponse>;
loginWithPassword: (login: string, password: string) => Promise<AuthTokens>;
loginWithLdap: (username: string, password: string) => Promise<AuthTokens>;
@@ -308,11 +308,10 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
}, []);
const sendLoginOtp = React.useCallback(async (recipient: string, channel?: string) => {
const response = await apiFetch<OtpSendResponse>('/auth/otp/send', {
return apiFetch<OtpSendResponse>('/auth/otp/send', {
method: 'POST',
body: JSON.stringify({ recipient, channel })
});
return response.maskedTarget;
}, []);
const verifyLoginOtp = React.useCallback(