Logout redirect to current url

Post author
Published media

Hey,

I have some problems when the user press the logout link - user always redirects on Home page. I have written for this link attribute data-ms-redirect="current-url" and expect that the user will stay on the same page, after logging out but it's not working properly.

How I can fix it?

Thanks :)

Comments

7 comments

  • Comment author
    Josh Lopez

    Hey there,

    Thank you for posting. The data attribute you are trying to use is for login and signup but not logout. Redirects can be added by following the steps in this doc.

    0
  • Comment author
    Published media

    Hey, thanks for the answer.

    Is it possible to make a redirect for the previous url with your advice? The same as it works with attribute when user login to cabinet?

    0
  • Comment author
    Duncan from Memberstack

    Published media Here's the article you're looking for https://docs.memberstack.com/hc/en-us/articles/20188140717979

    0
  • Comment author
    Published media

    Duncan Hamra I have already used it, it works properly for login but not works for logout...

    1
  • Comment author
    Duncan from Memberstack

    Ahhh I understand now. I'm afraid I don't have a solution for the logout link... how important is this for you?

    If it's super important you could add a script that redirects to the previous page when a link a param is present. And add the link param via the default logout redirect. 

    1
  • Comment author
    stanislas T

    It was not clear that log out, was not working with data-ms-redirect="current-url" 

    It should be nice that it works the same way as login.

    Now I struggle to make the log out page redirection (I have the impression that there is a bug on the logout redirect page). When I change the url it doesn't take it into account immediately.

    Can you advise ?

    0
  • Comment author
    Duncan from Memberstack

    It should be nice that it works the same way as login.

    Agreed! I'll ask Tyler about this. 

    I just did some testing on the logout redirects and they appear to be working for me... hmmmm.

    Can you confirm you are doing the following.

    1. Setting the logout redirect under default settings or plan settings
    2. Clicking on a button with data-ms-action="logout"
    3. And then you are being redirected to a page that is not your logout redirect?

    A video would be suuuuper helpful if you have the time. 

    0

Please sign in to leave a comment.