mirror of
https://github.com/janishutz/oidc-login-sdk.git
synced 2026-10-08 17:36:20 +02:00
feat: login through new tab
This commit is contained in:
1 parent
d1df43c57a
commit
6dd6581d41
1 file changed
+8
@@ -17,6 +17,14 @@ export const login = ( returnTo?: URL ) => {
|
|||||||
location.href = url.toString();
|
location.href = url.toString();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** Log in a user in a new browser tab or window */
|
||||||
|
export const loginInNewTab = () => {
|
||||||
|
const url = getBackendURL();
|
||||||
|
|
||||||
|
url.pathname = config.get().loginEndpoint ?? '/auth/v2/login';
|
||||||
|
window.open( url.toString() );
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a user is authenticated. This can also be done implicitly using a call to a protected endpoint
|
* Check if a user is authenticated. This can also be done implicitly using a call to a protected endpoint
|
||||||
* @returns A promise resolving to a boolean indicating authentication status
|
* @returns A promise resolving to a boolean indicating authentication status
|
||||||
|
|||||||
Reference in new issue
Block a user