Ver Fonte

update1.0

formation há 3 anos atrás
pai
commit
92ddec4806
1 ficheiros alterados com 6 adições e 6 exclusões
  1. 6 6
      angular-client/src/app/services/auth.service.ts

+ 6 - 6
angular-client/src/app/services/auth.service.ts

@@ -17,7 +17,7 @@ import * as jwt_decode from 'jwt-decode';
 export class AuthService {
 
   //url api
-  //private apiUrl = `https://api-preprod.foodgame.fr`;
+  private apiUrl = `https://api-preprod.foodgame.fr`;
 
 
   private tokenSubject: BehaviorSubject<Token>;
@@ -83,7 +83,7 @@ export class AuthService {
        //debugger;
       console.log("url ========",this.apiUrl);
   
-      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 => {
           // store jwt token in local storage 
           localStorage.setItem('token', JSON.stringify(token));
@@ -97,7 +97,7 @@ export class AuthService {
   // iscription get  token on login 
   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 => {
         // store jwt token in local storage 
         localStorage.setItem('token', JSON.stringify(token));
@@ -110,13 +110,13 @@ export class AuthService {
 
 // mot de passe oublie 
 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)
 }
 
 
 // réinitialiser mot de passe  
 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)
 }
 
   // isLoggedIn
@@ -139,7 +139,7 @@ resetPassword(data): Observable<any> {
   getUserInfo(): Observable<User> {
     
     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 => {
         // store user info in local storage 
         localStorage.setItem('user', JSON.stringify(user));