Created
March 5, 2021 22:08
-
-
Save bjoerntx/30432a071cc761e1f480ee7ff96f5d45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { HttpClient } from '@angular/common/http'; | |
import { Inject, Injectable } from '@angular/core'; | |
import { Resolve } from '@angular/router'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class OauthService implements Resolve<any> { | |
public _http: HttpClient; | |
public _baseUrl: string; | |
constructor(http: HttpClient, @Inject('BASE_URL') baseUrl: string) { | |
this._http = http; | |
this._baseUrl = baseUrl; | |
} | |
resolve() { | |
return this._http.get<any>(this._baseUrl + 'oauth/accesstoken'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment