hotfix: generateTokenWithOtp request change

This commit is contained in:
مهرزاد قدرتی
2025-08-16 16:40:09 +03:30
parent 14fb717c52
commit dd6e2fdd0d
4 changed files with 20 additions and 6 deletions

View File

@@ -35,7 +35,8 @@ export const generateTokenWithPassword = (
};
export interface GenerateTokenWithOTP {
username: string;
email?: string;
phonenumber?: string;
otp: string;
}
@@ -44,8 +45,9 @@ export const generateTokenWithOtp = (request: GenerateTokenWithOTP) => {
body.set('grant_type', 'otp');
body.set('client_id', import.meta.env.VITE_IDENTITY_CLIENT_ID);
body.set('scope', import.meta.env.VITE_IDENTITY_SCOPE);
body.set('username', request.username);
body.set('otp', request.otp);
if (request.email) body.set('email', request.email);
if (request.phonenumber) body.set('phonenumber', request.phonenumber);
body.set('otp_code', request.otp);
return apiClient.post<GenerateTokenResponse>(
import.meta.env.VITE_IDENTITY_URL,