-
Notifications
You must be signed in to change notification settings - Fork 0
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
logout endpoint auth_plug_example App issue #15 #16
Conversation
nelsonic
commented
Nov 4, 2021
•
edited
Loading
edited
- Implements MVP of logout functionality. ⏳ Implement Logout Endpoint/Handler in Example App #15
Codecov Report
@@ Coverage Diff @@
## main #16 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 3
Lines 12 14 +2
=========================================
+ Hits 12 14 +2
Continue to review full report at Codecov.
|
Need tests ... 🙄 |
Good thing testing in Elixir/Phoenix is so easy. 😉 |
The code I've added to this PR should be "enough" to logout in both the "consumer" ( |
@SimonLab hopefully this PR is clear. Once the person has |
|
||
def logout(conn, _params) do | ||
conn | ||
|> AuthPlug.logout() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the interesting part. 💡
With this single invocation of AuthPlug.logout/1
all "logout" action is handled transparently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if the logout function could failed before rendering the loggedout.html
page.
I've created an issue on auth_plug: dwyl/auth_plug#38
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent idea to check for errors. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍