Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created March 5, 2021 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/30432a071cc761e1f480ee7ff96f5d45 to your computer and use it in GitHub Desktop.
Save bjoerntx/30432a071cc761e1f480ee7ff96f5d45 to your computer and use it in GitHub Desktop.
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