redirect-to-login

A function used to navigate the browser to the login screen.

Installation#

npm install @iqmetrix/redirect-to-login

Interface#

const redirectToLogin: () => Promise<void>

Example#

import redirectToLogin from '@iqmetrix/redirect-to-login';
await redirectToLogin().catch(console.error);

Because this function navigates the browser away from the current page, we don't recommend adding a resolved handler as it isn't guaranteed to be executed.

Sources#

Last updated on by Paulo Andrade