Auth
Manages authorization use Auth.shared()
to get global instance
Static Member Summary
Static Public Members | ||
public static get |
Returns global instance of |
Static Method Summary
Static Public Methods | ||
public static |
oauthEndpointForSite(site: string, options: Object): string OAuth endpoint |
Constructor Summary
Public Constructor | ||
public |
Don't use this. Use |
Member Summary
Public Members | ||
public get |
Determines if user is authorized at the moment of call. |
|
public get |
Gets the current user. |
Method Summary
Public Methods | ||
public |
authorizeOAuth(site: string, options: Object): Promise<string> Authorizes for an OAuth site with auth config using CLIENT flow. |
|
public |
async ensureLoggedIn(reason: string): boolean Ensures the user is logged in. |
|
public |
async loginJWT(authData: AuthJWTToken): Promise Logs into a code-golf user using a JWT authorization key. |
|
public |
async logout() Logs the given user out. |
Static Public Members
Static Public Methods
public static oauthEndpointForSite(site: string, options: Object): string source
OAuth endpoint
Params:
Name | Type | Attribute | Description |
site | string | Site ID |
|
options | Object | ||
options.clientOnly | boolean |
|
A boolean specifying it to use client flow. |
options.authConfig | AuthConfig |
|
authorization config |
Public Constructors
Public Members
Public Methods
public authorizeOAuth(site: string, options: Object): Promise<string> source
Authorizes for an OAuth site with auth config using CLIENT flow.
Params:
Name | Type | Attribute | Description |
site | string | site ID |
|
options | Object |
|
Options for Auth.oauthEndpointForSite |
public async ensureLoggedIn(reason: string): boolean source
Ensures the user is logged in.
Params:
Name | Type | Attribute | Description |
reason | string |
|
Why this is being ensured. |
public async loginJWT(authData: AuthJWTToken): Promise source
Logs into a code-golf user using a JWT authorization key.
Params:
Name | Type | Attribute | Description |
authData | AuthJWTToken | Authorization data |