Get tokoen from backend

This commit is contained in:
Julius Gruber
2019-06-18 15:07:36 +02:00
parent 4504fa1818
commit 0355ff3e47
5 changed files with 54 additions and 82 deletions

View File

@@ -40,7 +40,7 @@ export class AuthRequestService {
return isNotEmpty(method) ? `${endpoint}/${method}` : `${endpoint}`;
}
public postToEndpoint(method: string, body: any, options?: HttpOptions): Observable<any> {
public postToEndpoint(method: string, body?: any, options?: HttpOptions): Observable<any> {
return this.halService.getEndpoint(this.linkName).pipe(
filter((href: string) => isNotEmpty(href)),
tap((href: string) => console.log('This is href in postToEndpoint(): ' , href)),
@@ -53,26 +53,6 @@ export class AuthRequestService {
distinctUntilChanged());
}
postToShibbEndpoint(): Observable<any> {
console.log('postToShibbLogin() was called');
return this.http.post('https://fis.tiss.tuwien.ac.at/Shibboleth.sso/Login',
{
name: 'morpheus',
job: 'leader'
})
/* .subscribe(
(val) => {
console.log('POST call successful value returned in body',
val);
},
(response) => {
console.log('POST call in error', response);
},
() => {
console.log('The POST observable is now completed.');
});*/
}
public getRequest(method: string, options?: HttpOptions): Observable<any> {
console.log('auth.request getRequest() was called');
return this.halService.getEndpoint(this.linkName).pipe(