Skip to content
Snippets Groups Projects

Feature/semantic enrichment

Merged Baptiste Toulemonde requested to merge feature/semantic_enrichment into master
3 files
+ 45
28
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -42,9 +42,9 @@ export class AuthService {
FdpSignUp(user: SmartHarvesterUser): Observable<any> {
const httpOptions = {
headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Authorization' : `Baerer ${this.getToken()}` })
headers: new HttpHeaders({ 'Content-Type': 'application/json', Authorization : `Baerer ${this.getToken()}` })
};
return this.http.post(`${this.baseUrl}/harvester/auth/signup`, {
firstName: user.firstName,
lastName: user.lastName,
@@ -57,6 +57,9 @@ export class AuthService {
const httpOptions = {
headers: new HttpHeaders({ 'Content-Type': 'application/json'})
};
if (!environment.staging && !environment.production) {
this.FdpBaseUrl = this.FdpBaseUrl.replace(':8080', '');
}
return this.http.post(`${this.FdpBaseUrl}/tokens`, {
email: email,
password: password
@@ -69,7 +72,7 @@ export class AuthService {
}
updateToken(token) {
this.tokenService.saveTokenSmartHarveser(token)
this.tokenService.saveTokenSmartHarveser(token);
}
fetchToken(code: string, state: string): Observable<any> {
@@ -86,13 +89,24 @@ export class AuthService {
}
isFdpLoggedIn(): boolean {
return !this.tokenService.getFDPToken();
}
logout() {
return this.http.post(this.baseUrl + '/harvester/logout', this.getToken(), this.httpOptions);
}
getUser(accessToken: string): Observable<any> {
const options = {
headers: new HttpHeaders({
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer ' + accessToken
})
};
return this.http.get(this.baseUrl + '/harvester/api/username', options);
}
}
Loading