Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to tackle with 2 authorization cookies #228

Open
gohelkiran30 opened this issue Aug 25, 2022 · 2 comments
Open

How to tackle with 2 authorization cookies #228

gohelkiran30 opened this issue Aug 25, 2022 · 2 comments

Comments

@gohelkiran30
Copy link

Is there any way to handle tokens from 2 different token values? Any one is present at a time. This is required for session cookies for different type of user.

For example,
buyer login has a cookie with name buyer-token and
seller login has a cookie with name seller-token.

If any one cookie is present than user should be authenticated.

Anyway to achieve this?

@wallacio
Copy link

My thoughts are that probably isn't the best way to approach your problem.
I think that using a single token, specifying a role (or roles) in that would be more correct.

@tuupola
Copy link
Owner

tuupola commented Aug 26, 2022

You could create another middleware which looks for the two cookies and if one is found renames it to token and configure this middleware to look for cookie named token.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants