Auth Service - liammcmanu/Tagged GitHub Wiki
The AuthService
class is responsible for handling authentication-related tasks. It contains the following methods:
public static async getAuthToken(): Promise<string | void>
This method fetches the OAuth token. It returns a promise that resolves to the OAuth token or void.
public static async revokeAuthToken(token: string): Promise<void>
This method revokes the provided OAuth token. It takes a token
parameter of type string
and returns a promise that resolves to void.
public static async hasAuthenticated(): Promise<boolean>
This method checks if the user is authenticated. It returns a promise that resolves to a boolean value indicating whether the user is authenticated or not.
To use the AuthService
class, follow these steps:
- Import the
AuthService
class from the appropriate file. - Call the desired method on the
AuthService
class to perform the authentication-related task.
Please refer to the code and comments in the provided code snippet for more details on the implementation of each method.