mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 00:38:11 +00:00
feat: ( iam ) add forgot and change password to passenger backoffice
This commit is contained in:
26
apps/edr-passenger-web/backoffice/src/lib/api/auth.ts
Normal file
26
apps/edr-passenger-web/backoffice/src/lib/api/auth.ts
Normal 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')}` },
|
||||
}),
|
||||
};
|
||||
Reference in New Issue
Block a user