Change organization for the user, using getAccessTokenSilently() method

Hi there,
I have a case where I have a table of the organizations I’m assigned.

I want to be able to change organizations when clicking on them.

Do we have a documentation for that or an example,

const handleSilentRelogin = async (org_id: string) => {
    try {
      // Attempt to get a new access token silently
      const accessToken = await getAccessTokenSilently({
        organization: org_id,
      });

      // If successful, you can use the new access token as needed
      console.log('Silent relogin successful. Access Token:', accessToken);
    } catch (error) {
      // If the silent relogin fails, redirect the user to the login page
      console.error('Silent relogin failed. Redirecting to login page.');
    }
  };

Hey there @llakud25 welcome to the community!

As far as I can tell switching organizations silently is not supported:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.