feat: ( iam ) add forgot and change password to passenger backoffice

This commit is contained in:
Abubeker Yasin
2026-07-02 10:27:08 +03:00
parent 448e64da02
commit d6938df66c
7 changed files with 585 additions and 4 deletions

View File

@@ -0,0 +1,26 @@
import axios from 'axios';
const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000';
export const iamAuthApi = {
forgotPassword: (email: string) =>
axios.post(`${API_URL}/v1/auth/forgot-password`, { email }),
resetPassword: (data: {
userId: string;
email: string;
verificationCode: string;
newPassword: string;
confirmPassword: string;
}) => axios.patch(`${API_URL}/v1/auth/set-password`, data),
changePassword: (data: {
oldPassword: string;
newPassword: string;
confirmPassword: string;
}) =>
axios.patch(`${API_URL}/v1/auth/change-password`, data, {
headers: { Authorization: `Bearer ${localStorage.getItem('auth_token')}` },
}),
};