# Okta signin-widget automatically redirect users already logged

**URL:** <https://devforum.okta.com/t/okta-signin-widget-automatically-redirect-users-already-logged/21534>\
**Category:** OAuth/OIDC\
**Tags:** oauth, widget, angular\
**Created:** [August 10, 2022, 11:15am UTC](https://devforum.okta.com/t/okta-signin-widget-automatically-redirect-users-already-logged/21534 "2022-08-10T11:15:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fcerullo](https://avatars.discourse-cdn.com/v4/letter/f/edb3f5/32.png) [@fcerullo](https://devforum.okta.com/u/fcerullo)\
**Post date:** [August 10, 2022, 11:15am UTC](https://devforum.okta.com/t/okta-signin-widget-automatically-redirect-users-already-logged/21534/1 "2022-08-10T11:15:38Z")

</div>

Hi All  
we have an angular SPA using below Okta js libraries:

```auto
"@okta/okta-angular": "^5.2.0",
"@okta/okta-auth-js": "6.7.4",
"@okta/okta-signin-widget": "6.6.1"

```

token/storage oktaAuth settings are as below:

```auto
"tokenManager": {
    "storage": "sessionStorage"
},
"storageManager": {
    "token": {
        "storageType": "sessionStorage",
        "storageTypes": []
    },
    "cache": {
        "storageType": "sessionStorage",
        "storageTypes": []
    },
    "transaction": {
        "storageType": "sessionStorage",
        "storageTypes": []
    }
}

```

interactionCodeFlow is set as true in the signin-widget config.

I was wondering if there’s an option to avoid a user to be already logged opening a new tab, as well as opening a new browser window.  
e.g. in fact if I log in in tab A and then I open the tab B (same url), the signin-widget will automatically redirect the user to the main application page as the user result already authenticated.  
Any chance to avoid above behaviour or is intended as the expected one?

Thanks,  
F

---

<div class="post-metadata">

**Author:** ![erik](https://avatars.discourse-cdn.com/v4/letter/e/b5ac83/32.png) [@erik](https://devforum.okta.com/u/erik)\
**Post date:** [August 12, 2022, 8:11pm UTC](https://devforum.okta.com/t/okta-signin-widget-automatically-redirect-users-already-logged/21534/2 "2022-08-12T20:11:12Z")

</div>

Hello,  
With the interaction flow it is expected, when you render the widget it will make a couple of calls where it is returned that the user already has a session so tokens will be retrieved.  
You can test if an Okta session already exists and if so not render the widget.

Is the goal to be able to login with a different account in the same browser where an existing Okta session already exists?

---

<div class="post-metadata">

**Author:** ![Saurabh126](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@Saurabh126](https://devforum.okta.com/u/Saurabh126)\
**Post date:** [February 21, 2023, 2:07pm UTC](https://devforum.okta.com/t/okta-signin-widget-automatically-redirect-users-already-logged/21534/3 "2023-02-21T14:07:11Z")

</div>

@erik your response is matching with my question I been looking into different posts but haven’t found the answer yet. My purpose is access different application in same browser and user shouldn’t logged in separately in each application. Just wanted your help to know how I can check if session is already with interaction code?

Can you please help with my query ? Thanks

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [February 13, 2024, 1:05am UTC](https://devforum.okta.com/t/okta-signin-widget-automatically-redirect-users-already-logged/21534/4 "2024-02-13T01:05:33Z")

</div>

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