|
@@ -71,7 +71,7 @@ export class AuthService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
signInAdmin(credentials): Observable<Token> {
|
|
signInAdmin(credentials): Observable<Token> {
|
|
|
- return this.http.post<Token>(`${this.apiUrl}/api/auth/admin`, credentials)
|
|
|
|
|
|
|
+ return this.http.post<Token>(`https://api-preprod.foodgame.fr/api/auth/admin`, credentials)
|
|
|
.pipe(map(token => {
|
|
.pipe(map(token => {
|
|
|
this.storageService.setItem('token', JSON.stringify(token));
|
|
this.storageService.setItem('token', JSON.stringify(token));
|
|
|
this.tokenSubject.next(token);
|
|
this.tokenSubject.next(token);
|
|
@@ -80,7 +80,7 @@ export class AuthService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
signUP(data): Observable<Token> {
|
|
signUP(data): Observable<Token> {
|
|
|
- return this.http.post<Token>(`${this.apiUrl}/api/auth/signup`, data)
|
|
|
|
|
|
|
+ return this.http.post<Token>(`https://api-preprod.foodgame.fr/api/auth/signup`, data)
|
|
|
.pipe(map(token => {
|
|
.pipe(map(token => {
|
|
|
this.storageService.setItem('token', JSON.stringify(token));
|
|
this.storageService.setItem('token', JSON.stringify(token));
|
|
|
this.tokenSubject.next(token);
|
|
this.tokenSubject.next(token);
|
|
@@ -89,11 +89,11 @@ export class AuthService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
lostPassword(email): Observable<any> {
|
|
lostPassword(email): Observable<any> {
|
|
|
- return this.http.put<any>(`${this.apiUrl}/api/auth/forgot-password`, email);
|
|
|
|
|
|
|
+ return this.http.put<any>(`https://api-preprod.foodgame.fr/api/auth/forgot-password`, email);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
resetPassword(data): Observable<any> {
|
|
resetPassword(data): Observable<any> {
|
|
|
- return this.http.put<any>(`${this.apiUrl}/api/auth/reset-password`, data);
|
|
|
|
|
|
|
+ return this.http.put<any>(`https://api-preprod.foodgame.fr/api/auth/reset-password`, data);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public isLoggedIn() {
|
|
public isLoggedIn() {
|
|
@@ -123,7 +123,7 @@ export class AuthService {
|
|
|
|
|
|
|
|
getUserInfo(): Observable<User> {
|
|
getUserInfo(): Observable<User> {
|
|
|
let decodedToken: payloadToken = jwt_decode(this.tokenSubject.value.token);
|
|
let decodedToken: payloadToken = jwt_decode(this.tokenSubject.value.token);
|
|
|
- return this.http.get<User>(`${this.apiUrl}/api/users/${decodedToken.userId}`)
|
|
|
|
|
|
|
+ return this.http.get<User>(`https://api-preprod.foodgame.fr/api/users/${decodedToken.userId}`)
|
|
|
.pipe(map(user => {
|
|
.pipe(map(user => {
|
|
|
this.storageService.setItem('user', JSON.stringify(user));
|
|
this.storageService.setItem('user', JSON.stringify(user));
|
|
|
this.user_infoSubject.next(user);
|
|
this.user_infoSubject.next(user);
|