You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since nowhere in docs mention what is reserved session key for storing current user (I assume it's always session->{yancy}{auth} but still ) I think it could be useful to add into Yancy::Plugin::Auth section how to properly logout. I assume that it's always possible to do with delete $c->session->{yancy}{auth}, something like
get '/logout'=>sub {
my ( $c ) = @_;
delete$c->session->{yancy}{auth};
$c->redirect_to('/');
};
But maybe there is some public method to do logout ? Or should we add it?
Auth::Basic is deprecated and not used by the main auth plugin. You want to read Yancy::Plugin::Auth::Password. I will add some documentation saying where to get the logout route for that plugin (the route's name is yancy.auth.password.logout). I will also add a generic logout method and route to the main plugin so folks can do what they wish. Thanks for finding this issue!
[Added]
- Added the ability for any "route" configuration to be a string.
These will automatically be made into routes for you. Thanks
@pavelsr for the suggestion! [Github #90]
- Added "yancy.auth.logout" helper and route so that any authed user
can be cleared out from any auth plugin. Thanks @pavelsr for the
suggestion! [Github #91]
[Fixed]
- Fixed a bunch of missing/broken documentation (found by @pavelsr
in #90, #91, and #92)
Since nowhere in docs mention what is reserved session key for storing current user (I assume it's always
session->{yancy}{auth}
but still ) I think it could be useful to add into Yancy::Plugin::Auth section how to properly logout. I assume that it's always possible to do withdelete $c->session->{yancy}{auth}
, something likeBut maybe there is some public method to do logout ? Or should we add it?
Searching by code I've found that you made logout in Yancy::Plugin::Auth::Basic like
But when I tried to do similar in my app
I've got an error,
Can't locate object method "clear" via package "Mojolicious::Renderer::Helpers::4d3bfb8b02efde8b1bbef4956167936a"
The text was updated successfully, but these errors were encountered: