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

Add possibility to refresh tokens without access token. #66

Closed
wants to merge 1 commit into from

Conversation

Bilanuk
Copy link

@Bilanuk Bilanuk commented Nov 19, 2022

And i also implemented my version of @hassanrbh PR(#63)
Still needs a lot of work to be prod ready. Just want to share my idea.

Copy link

@hassanrbh hassanrbh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice , a question is why you are storing both the access token and refresh token in the cookies ?

@Bilanuk
Copy link
Author

Bilanuk commented Nov 21, 2022

nice , a question is why you are storing both the access token and refresh token in the cookies ?

Sry for not replying for too long.
I decided to store in cookies just because i thougth it was more secure than just using JS to manipulate both of them. And it was much easier to handle with react and axios.
Today i did a little research and found that storing both tokens in cookies can lead to csrf attack. And storing in localstorage can lead to xss attack.
Also the creator of this gem pointed out the idea: #47 (comment)
I think that the best idea to store tokens is just to let the users of gem to decide where to store each token (body/header/cookie).
So they can use your strategy as well:
#63 (comment)

@Bilanuk
Copy link
Author

Bilanuk commented Nov 21, 2022

nice , a question is why you are storing both the access token and refresh token in the cookies ?

Sry for not replying for too long. I decided to store in cookies just because i thougth it was more secure than just using JS to manipulate both of them. And it was much easier to handle with react and axios. Today i did a little research and found that storing both tokens in cookies can lead to csrf attack. And storing in localstorage can lead to xss attack. Also the creator of this gem pointed out the idea: #47 (comment) I think that the best idea to store tokens is just to let the users of gem to decide where to store each token (body/header/cookie). So they can use your strategy as well: #63 (comment)

@Gokul595 what you think about different strategies of storing tokens?

@hassanrbh
Copy link

hey @Bilanuk yeah that pretty nice idea, just let the client to choose his own strategy

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

Successfully merging this pull request may close these issues.

2 participants