diff --git a/browser/src/auth.ts b/browser/src/auth.ts index aded4c4..a0b9dc1 100644 --- a/browser/src/auth.ts +++ b/browser/src/auth.ts @@ -27,13 +27,14 @@ export const loginInNewTab = () => { /** * Check if a user is authenticated. This can also be done implicitly using a call to a protected endpoint + * @param query Query string, without the leading question mark. E.g. `test=true&force=false` * @returns A promise resolving to a boolean indicating authentication status */ -export const check = async (): Promise => { +export const check = async ( query?: string ): Promise => { let status: boolean; try { - status = ( await request.get( config.get().authCheckEndpoint ?? '/auth/v2/check' ) ).ok; + status = ( await request.get( config.get().authCheckEndpoint ?? '/auth/v2/check' + ( query ? '?' + query : '' ) ) ).ok; } catch ( e ) { if ( e instanceof AuthError ) { status = false;