|
|
@@ -16,7 +16,7 @@ import { StorageService } from 'src/app/services/storage.service'; // Assurez-vo
|
|
|
providedIn: 'root'
|
|
|
})
|
|
|
export class AuthService {
|
|
|
- private apiUrl = `https://api-preprod.foodgame.fr`;
|
|
|
+ private apiUrl = environment.apiUrl;
|
|
|
private currentUserSubject: BehaviorSubject<User> = new BehaviorSubject<User>(null);
|
|
|
public currentUser: Observable<User> = this.currentUserSubject.asObservable();
|
|
|
private tokenSubject: BehaviorSubject<Token>;
|
|
|
@@ -52,7 +52,7 @@ export class AuthService {
|
|
|
}
|
|
|
|
|
|
signIn(credentials): Observable<Token> {
|
|
|
- return this.http.post<Token>(`${this.apiUrl}/api/auth/login`, credentials)
|
|
|
+ return this.http.post<Token>(`https://api-preprod.foodgame.fr/api/auth/login`, credentials)
|
|
|
.pipe(map(token => {
|
|
|
this.storageService.setItem('token', JSON.stringify(token));
|
|
|
this.tokenSubject.next(token);
|