refactor: rewrite oauth setup for the new api
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import {Injectable} from "@angular/core";
|
||||
import ApiService, {AvailableVersion} from "@api/api.service";
|
||||
import {catchError, of, switchMap} from "rxjs";
|
||||
import {catchError, of} from "rxjs";
|
||||
import {DatabaseResponse} from "@api/v1/configuration/databaseResponse";
|
||||
import {DatabaseRequest} from "@api/v1/configuration/databaseRequest";
|
||||
import {CacheRequest} from "@api/v1/configuration/cacheRequest";
|
||||
@ -137,18 +137,21 @@ export default class SetupService extends ApiService {
|
||||
|
||||
public adminConfiguration() {
|
||||
let request = this.createRequestBuilder()
|
||||
.setEndpoint('UpdateAdminConfiguration')
|
||||
.setEndpoint('AdminConfiguration')
|
||||
.setWithCredentials()
|
||||
.build;
|
||||
|
||||
return this.get(request).pipe(switchMap(_ => {
|
||||
request = this.createRequestBuilder()
|
||||
.setEndpoint('AdminConfiguration')
|
||||
.setWithCredentials()
|
||||
.build;
|
||||
return this.get<UserResponse>(request);
|
||||
}
|
||||
|
||||
return this.get<UserResponse>(request);
|
||||
}));
|
||||
public registerOAuth(token: string) {
|
||||
let request = this.createRequestBuilder()
|
||||
.setEndpoint('HandleToken')
|
||||
.setQueryParams({token: token})
|
||||
.setWithCredentials()
|
||||
.build;
|
||||
|
||||
return this.get<null>(request);
|
||||
}
|
||||
|
||||
public setLogging(data: LoggingRequest | null = null) {
|
||||
|
Reference in New Issue
Block a user