use the new login function
This commit is contained in:
@@ -9,6 +9,18 @@ import {
|
||||
} from '../types';
|
||||
|
||||
export class Auth {
|
||||
static triggerLoginFlow(): void {
|
||||
const url = [
|
||||
Configuration.vatsim.authorizeUrl,
|
||||
`?client_id=${Configuration.vatsim.clientId}`,
|
||||
`&redirect_uri=${Configuration.resourceServer}/auth/vatsim`,
|
||||
`&response_type=code`,
|
||||
`&scope=full_name+vatsim_details`,
|
||||
`&approval_prompt=auto`,
|
||||
].join('');
|
||||
window.location.replace(url);
|
||||
}
|
||||
|
||||
static async tokenIsValid(): Promise<BackendReturnStatus> {
|
||||
const token = Session.bearerToken();
|
||||
if (!token) return BackendReturnStatus.Unauthorized;
|
||||
|
||||
Reference in New Issue
Block a user