export the isAuthorized function
This commit is contained in:
@@ -219,7 +219,7 @@ export class UmbAuthFlow {
|
||||
*
|
||||
* @returns true if the user is logged in, false otherwise.
|
||||
*/
|
||||
loggedIn(): boolean {
|
||||
isAuthorized(): boolean {
|
||||
return !!this.#accessTokenResponse && this.#accessTokenResponse.isValid();
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,10 @@ export class UmbAuthContext implements IUmbAuth {
|
||||
return this.#authFlow.makeAuthorizationRequest();
|
||||
}
|
||||
|
||||
isAuthorized() {
|
||||
return this.#authFlow.isAuthorized();
|
||||
}
|
||||
|
||||
setInitialState(): Promise<void> {
|
||||
return this.#authFlow.setInitialState();
|
||||
}
|
||||
|
||||
@@ -12,6 +12,11 @@ export interface IUmbAuth {
|
||||
*/
|
||||
setInitialState(): Promise<void>;
|
||||
|
||||
/**
|
||||
* Checks if there is a token and it is still valid.
|
||||
*/
|
||||
isAuthorized(): boolean;
|
||||
|
||||
/**
|
||||
* Gets the latest token from the Management API.
|
||||
* If the token is expired, it will be refreshed.
|
||||
|
||||
Reference in New Issue
Block a user