formation 3 years ago
parent
commit
ca3fd6be19

File diff suppressed because it is too large
+ 1 - 1
angular-client/dist/fatboar/index.html


File diff suppressed because it is too large
+ 1 - 1
angular-client/dist/fatboar/main-es2015.d8657cab72f5112b5618.js


File diff suppressed because it is too large
+ 1 - 1
angular-client/dist/fatboar/main-es5.d8657cab72f5112b5618.js


+ 1 - 2
angular-client/src/app/components/register/register.component.ts

@@ -132,7 +132,7 @@ export class RegisterComponent implements OnInit {
   // }
    //google signIn
    signGoogle(){
-    window.location.href =`http://localhost:4000/api/auth/google`
+    window.location.href =`https://api-prod.foodgame.fr/api/auth/google`
     // this.authService.signGoogle().subscribe(
     //   data=> {
     //       console.log(data); 
@@ -153,7 +153,6 @@ export class RegisterComponent implements OnInit {
    this.loading = true;
    this.authService.signUP(this.formGroup.value).subscribe(
     data => {
-        // this.router.navigate([this.returnUrl]);
         console.log(data)
         this.loading = false;
         this.router.navigate(['/auth']);

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

@@ -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));