|
|
@@ -58,7 +58,7 @@ export class AuthService {
|
|
|
//debugger;
|
|
|
// console.log("url ========",this.apiUrl);
|
|
|
|
|
|
- return this.http.post<Token>(`${this.apiUrl}/auth/login`, credentials)
|
|
|
+ return this.http.post<Token>(`${this.apiUrl}/api/auth/login`, credentials)
|
|
|
.pipe(map(token => {
|
|
|
// store jwt token in local storage
|
|
|
localStorage.setItem('token', JSON.stringify(token));
|
|
|
@@ -83,7 +83,7 @@ export class AuthService {
|
|
|
//debugger;
|
|
|
//console.log("url ========",this.apiUrl);
|
|
|
|
|
|
- return this.http.post<Token>(`${this.apiUrl}/auth/admin`, credentials)
|
|
|
+ return this.http.post<Token>(`${this.apiUrl}/api/auth/admin`, credentials)
|
|
|
.pipe(map(token => {
|
|
|
// store jwt token in local storage
|
|
|
localStorage.setItem('token', JSON.stringify(token));
|
|
|
@@ -100,7 +100,7 @@ export class AuthService {
|
|
|
// console.log("url ========",this.apiUrl);
|
|
|
|
|
|
|
|
|
- return this.http.post<Token>(`${this.apiUrl}/auth/signup`, data)
|
|
|
+ return this.http.post<Token>(`${this.apiUrl}/api/auth/signup`, data)
|
|
|
.pipe(map(token => {
|
|
|
// store jwt token in local storage
|
|
|
localStorage.setItem('token', JSON.stringify(token));
|
|
|
@@ -113,13 +113,13 @@ export class AuthService {
|
|
|
|
|
|
// mot de passe oublie
|
|
|
lostPassword(email): Observable<any> {
|
|
|
- return this.http.put<any>(`${this.apiUrl}/auth/forgot-password`, email)
|
|
|
+ return this.http.put<any>(`${this.apiUrl}/api/auth/forgot-password`, email)
|
|
|
}
|
|
|
|
|
|
|
|
|
// réinitialiser mot de passe
|
|
|
resetPassword(data): Observable<any> {
|
|
|
- return this.http.put<any>(`${this.apiUrl}/auth/reset-password`, data)
|
|
|
+ return this.http.put<any>(`${this.apiUrl}/api/auth/reset-password`, data)
|
|
|
}
|
|
|
|
|
|
// isLoggedIn
|
|
|
@@ -145,7 +145,7 @@ resetPassword(data): Observable<any> {
|
|
|
getUserInfo(): Observable<User> {
|
|
|
|
|
|
let decodedToken : payloadToken = jwt_decode(this.tokenSubject.value.token);
|
|
|
- return this.http.get<User>(`${this.apiUrl}/users/${decodedToken.userId}`)
|
|
|
+ return this.http.get<User>(`${this.apiUrl}/api/users/${decodedToken.userId}`)
|
|
|
.pipe(map(user => {
|
|
|
// store user info in local storage
|
|
|
localStorage.setItem('user', JSON.stringify(user));
|