Removed global config from auth.service

This commit is contained in:
Julius Gruber
2019-06-04 13:02:40 +02:00
parent 3dfdc9bdc5
commit ef9447cb54
4 changed files with 40 additions and 26 deletions

View File

@@ -43,7 +43,7 @@ export class AuthService {
protected _authenticated: boolean;
constructor(
@Inject(GLOBAL_CONFIG) public config: GlobalConfig,
// @Inject(GLOBAL_CONFIG) public config: GlobalConfig,
@Inject(REQUEST) protected req: any,
@Inject(NativeWindowService) protected _window: NativeWindowRef,
protected authRequestService: AuthRequestService,
@@ -203,18 +203,20 @@ export class AuthService {
*/
public retrieveAuthMethods(): Observable<string> {
console.log('auth.service retrieveAuthMethods() was called');
return this.authRequestService.getRequest('login').pipe(
// return this.authRequestService.getRequest('login').pipe(
return this.authRequestService.postToEndpoint('login', {}).pipe(
map((status: AuthStatus) => {
let url = '';
if (isNotEmpty(status.ssoLoginUrl)) {
url = this.parseSSOLocation(status.ssoLoginUrl);
// url = this.parseSSOLocation(status.ssoLoginUrl);
url = 'https://fis.tiss.tuwien.ac.at/Shibboleth.sso/Login?target=https%3A%2F%2Ffis.tiss.tuwien.ac.at';
}
return url;
})
)
}
private parseSSOLocation(url: string): string {
/* private parseSSOLocation(url: string): string {
console.log('auth.service parseSSOLocation was called');
const parseUrl = decodeURIComponent(url);
// const urlTree: UrlTree = this.router.parseUrl(url);
@@ -227,7 +229,7 @@ export class AuthService {
// console.log(url);
const target = `?target=${this.config.auth.target.host}${this.config.auth.target.page}`;
return parseUrl.replace(/\?target=http.+/g, target);
}
}*/
/**
* Create a new user