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

Cookie not persisting in api only application after updating the gem to 2.3.1 #937

Closed
mohanhari opened this issue Mar 29, 2021 · 4 comments

Comments

@mohanhari
Copy link

In the rails API only application the cookie is saving in the browser and also in RSpec after updating the gem version to 2.3.1. It's working good in 2.3.0 or the previous version. Do you guys know what could be the problem?

@MottiniMauro
Copy link
Contributor

Hi @mohanhari , thanks for opening this issue. I don't think I'm getting a clear understanding of what's not working, could you provide some more information on how to reproduce this?

@mohanhari
Copy link
Author

Hi @mohanhari , thanks for opening this issue. I don't think I'm getting a clear understanding of what's not working, could you provide some more information on how to reproduce this?

HI @MottiniMauro, Create a rails API only application and install clearance gem. After logging in the cookie should be stored and retrieved for other requests. Before clearance version 2.3.1 this was working fine. But when I update the clearance version 2.3.1, after login in the cookie is created but it's not retrieving for other requests. I saw that you added an option for a signed cookie in the latest release, could that be the problem?. It can also be reproduced in RSpec request spec.

@MottiniMauro
Copy link
Contributor

After checking this it looks like clearance is not meant to work with rails API mode out of the box, so it really depends on what you built on top of it. I would recommend checking our wiki for some suggestions on how to do API authentication

@mohanhari
Copy link
Author

@MottiniMauro Previous versions of clearance supported the Rails API mode with cookie-based authentication instead of token-based authentication. So what changed now that makes the new version not supporting the cookie-based authentication in Rails API mode.

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

2 participants