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

feat: make session cookie #345

Merged
merged 5 commits into from
Feb 24, 2023
Merged

feat: make session cookie #345

merged 5 commits into from
Feb 24, 2023

Conversation

pichoemr
Copy link
Contributor

@pichoemr pichoemr commented Feb 23, 2023

Closes #313

Checklist

  • I didn't over-scope my PR
  • My PR title matches the commit convention
  • I did not include breaking changes
  • I included unit tests that cover my changes
  • I added/updated the documentation about my changes
  • I made my own code-review before requesting one

Description of the changes

Technical highlight/advice

@pichoemr pichoemr self-assigned this Feb 23, 2023
@jonas-martinez
Copy link
Collaborator

jonas-martinez commented Feb 23, 2023

@pichoemr Can you add a description to this PR or link it to an issue to better understand why we add a session cookie ?

@jonas-martinez jonas-martinez added the enhancement New feature or request label Feb 23, 2023
@pichoemr
Copy link
Contributor Author

@jonas-martinez #313

Copy link
Collaborator

@jonas-martinez jonas-martinez left a comment

Choose a reason for hiding this comment

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

This is not working properly.

When the keep me logged in box is NOT checked, it works. Here are the logs :

[info] Sent 200 in 21ms
[info] POST /auth/logout
[debug] Processing with LenraWeb.UserController.logout/2
  Parameters: %{}
  Pipelines: [:api, :ensure_auth_refresh]
[debug] QUERY OK source="guardian_tokens" db=4.8ms idle=1152.8ms
SELECT g0."jti", g0."typ", g0."aud", g0."iss", g0."sub", g0."exp", g0."jwt", g0."claims", g0."inserted_at", g0."updated_at" FROM "guardian_tokens" AS g0 WHERE ((g0."jti" = $1) AND (g0."aud" = $2)) ["48d0b11b-c886-4782-a94f-f06e124f4f15", "lenra"]
[debug] QUERY OK source="users" db=1.6ms idle=982.6ms
SELECT u0."id", u0."first_name", u0."last_name", u0."email", u0."role", u0."inserted_at", u0."updated_at" FROM "users" AS u0 WHERE (u0."id" = $1) [1]
[debug] QUERY OK source="guardian_tokens" db=1.9ms idle=979.7ms
SELECT g0."jti", g0."typ", g0."aud", g0."iss", g0."sub", g0."exp", g0."jwt", g0."claims", g0."inserted_at", g0."updated_at" FROM "guardian_tokens" AS g0 WHERE ((g0."jti" = $1) AND (g0."aud" = $2)) ["48d0b11b-c886-4782-a94f-f06e124f4f15", "lenra"]
[debug] QUERY OK db=7.8ms queue=3.2ms idle=978.1ms
DELETE FROM "guardian_tokens" WHERE "jti" = $1 ["48d0b11b-c886-4782-a94f-f06e124f4f15"]

When the keep me logged in box is checked, it does not work. Here are the logs

[info] Sent 200 in 20ms
[info] POST /auth/logout
[debug] Processing with LenraWeb.UserController.logout/2
  Parameters: %{}
  Pipelines: [:api, :ensure_auth_refresh]
[debug] QUERY OK source="guardian_tokens" db=42.7ms idle=993.3ms
SELECT g0."jti", g0."typ", g0."aud", g0."iss", g0."sub", g0."exp", g0."jwt", g0."claims", g0."inserted_at", g0."updated_at" FROM "guardian_tokens" AS g0 WHERE ((g0."jti" = $1) AND (g0."aud" = $2)) ["48d0b11b-c886-4782-a94f-f06e124f4f15", "lenra"]
[info] Sent 401 in 48ms
[debug] Phoenix.Router halted in :ensure_auth_refresh/2

@jonas-martinez jonas-martinez merged commit d7a92af into beta Feb 24, 2023
@jonas-martinez jonas-martinez deleted the session-cookie branch February 24, 2023 13:07
@shiipou
Copy link
Contributor

shiipou commented Apr 4, 2023

🎉 This PR is included in version 1.0.0-alpha.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@taorepoara
Copy link
Member

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

[Bug] Logout button not working when the Keep me logged in button is not checked
4 participants