Jump to content

P21 Logout action/view


SiNNuT
 Share

Recommended Posts

After being away for a while i just picked up a fresh copy of P21 from Github. Something i noticed when logging out in P21: username, profile-, and logout link are still visible after a successful logout . This seems rather illogical/confusing. Also, imo the wording of the continue link should make clear where it leads. Maybe something like: "Continue to public site or log back in".

before.png

after.png

Link to comment
Share on other sites

I always feel (and always do my apps this way), that 'logout' link should lead to log-in screen with successful logout message, no middle man (page just for logged out message).

+1

Link to comment
Share on other sites

I always feel (and always do my apps this way), that 'logout' link should lead to log-in screen with successful logout message, no middle man (page just for logged out message).

That would be fine as well and is a matter of taste to some extent.

However, the main reason i made this post  is the second screenshot: after a successful logout the bottom right text and links don't correspond to the logged out status. Unless there is some rational behind this behavior that i don't see i think this could be called a small bug or at least something that could be improved.

Link to comment
Share on other sites

However, the main reason i made this post  is the second screenshot: after a successful logout the bottom right text and links don't correspond to the logged out status. Unless there is some rational behind this behavior that i don't see i think this could be called a small bug or at least something that could be improved.

That is true. There is also admin nav showing, which is not relevant also.

But I think that what Adam proposed is something that is a) probably very simple to implement (there is already clean login view where there is not these probems) b) is also conventional - many apps do it this way and c) seeing login screen is strong message that you are really logged out.

Link to comment
Share on other sites

But I think that what Adam proposed is something that is a) probably very simple to implement (there is already clean login view where there is not these probems) b) is also conventional - many apps do it this way and c) seeing login screen is strong message that you are really logged out.

Agreed, nice and simple solution, on logout just redirect to the clean login view.

Link to comment
Share on other sites

Hey guys, this makes sense to me. I'll plan to implement. I can't say as though I ever really logout of my PW installs, so have probably only seen the logout screen a handful of times. When all that stuff on the screen is drawn, they are actually still logged in (though by the time you see it, they aren't) so that's why you are seeing links to stuff that's not applicable. I'll put a redirect in between those which will solve that part of it.

Link to comment
Share on other sites

+1 for login screen after logout

Hi, guys. It seems like I've encountered a bug in PW2.1 during login procedure (using Chrome). When I login as a test user, then log out and after that tryin' to login as an admin I get this message, which doesen't really make sense :)

FynOI.jpg

And after I have to login again, this time successfully.

Cheers  ;)

Link to comment
Share on other sites

It looks to me like you were logging in on the /processwire/login/logout/ page? Hitting that page always logs you out. You can login on any page just by pointing your browser to it... if you don't have access, you'll get a login form. So if you hit the /logout/ page and you aren't already logged in, you'll get a login form. The behavior is intentional (for all admin pages), but this particular iteration of it isn't useful and is confusing as you found out. :) I want to retain the behavior, but want to remove any links that might point one to experience that confusing behavior. What path did you take to get to the logout page? Did you reload it or click one of the links we're going to remove (mentioned in the previous messages)? Other than those instances, the only way I can duplicate this in Chrome (or other browser) is by pointing my browser to the /logout/ page when I'm not already logged in. Perhaps the update discussed earlier will solve this one too (since we'll redirect back to the login page), but just wanted to double check.

Link to comment
Share on other sites

I think that the solution would be having just 'login' page?

If you open /login/, than just login is presented. if you open /login/?logout=1, or something like that (via GET vars), you are first logged out and then the login screen is loaded.

Also, this would allow something like this:

<?php
  if ($this->input->get('logout') === '1'){
    if ($hasPermission){
      //logout
    }else{
      //ignore();
    }
  }

  loadLogInForm();

Nice and simple :)

Link to comment
Share on other sites

I've just pushed an update that makes it redirect back to the admin  page after logout (which forces it to show the login form again):

https://github.com/ryancramerdesign/P21/commits/master

Adam: In PW 2.1, there is no specific 'logout' page, rather it's just an executeLogout() function in the ProcessLogin module (a URL segment handling function). It's very similar to what you've described except it uses a url segment rather than get var.

Link to comment
Share on other sites

Hi Ryan. Yes, I was trying to log in on the /processwire/login/logout/ by pressing continue link and then "back" browser button or just refreshing the page.

I want to retain the behavior, but want to remove any links that might point one to experience that confusing behavior.

I'm not sure this behaviour is useful. I would just redirect user from /processwire/login/logout/ to /processwire/login/ or even better use only /processwire/login/ (as Adamkiss wrote) and show user additional info box after they logged out "You have logged out". Also I would show a link "homepage" or something like that on a login page.

One more thing concerning info boxes. When I log in as an admin I see two boxes:

1) Successful login for admin

2) You are logged in.

From usability point of view IMHO it's a bit redundant. Better would be to have just one message:

You are logged in as admin.

Correct me if I'm missing the point, because I don't know all the inner functioning of PW.

Update: Ryan, didn't see your post when was writing this. Good to know this changes already commited  :)

Link to comment
Share on other sites

You are right, that would be redundant. :) Those two messages actually get queued during different requests, but PW will keep them queued until it can display them, so that's why you may have seen them both. Sometimes obvious things like this I get used to, tune them out, and no longer notice. So I'm glad to have fresh eyes on this stuff.

I just tested here in 2.1 and am not seeing both messages together, so I think the latest updates must have resolved that as well. But let me know if you see those redundant messages again.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...