matrix-dimension/web/app/shared/services/AuthedApi.ts

15 lines
430 B
TypeScript
Raw Normal View History

import { Http, Response } from "@angular/http";
import { Observable } from "rxjs/Observable";
2017-12-22 23:08:10 -05:00
import { SessionStorage } from "../SessionStorage";
export class AuthedApi {
constructor(protected http: Http) {
}
protected authedGet(url: string, qs?: any): Observable<Response> {
if (!qs) qs = {};
2017-12-22 23:08:10 -05:00
qs["scalar_token"] = SessionStorage.scalarToken;
return this.http.get(url, {params: qs});
}
}