pressbooks / pressbooks-saml-sso

SAML2 Single Sign-On integration for Pressbooks (Shibboleth, ADFS, Google Apps, Etc.)
GNU General Public License v3.0
3 stars 1 forks source link

fix: redirect regular users to previous URL with forced redirection option #173

Closed richard015ar closed 1 year ago

richard015ar commented 1 year ago

Related issue: https://github.com/pressbooks/private/issues/941

This PR fixes the logout redirection behaviour for regular WP users when the Hide the Pressbooks login page. (forced redirection) option enabled.

Bug description

Expected behaviour

The user is logged out and redirected to the previous page (the Network home page in the test case).

Current behaviour

The user is logged out and redirected to the WP Login page.

Test case

Follow the previous steps, and make sure the behaviour is the expected one.

codecov[bot] commented 1 year ago

Codecov Report

Merging #173 (a4a7c26) into dev (0ef84ac) will increase coverage by 0.14%. The diff coverage is n/a.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/pressbooks/pressbooks-saml-sso/pull/173/graphs/tree.svg?width=650&height=150&src=pr&token=sHRYPkj6j4&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pressbooks)](https://app.codecov.io/gh/pressbooks/pressbooks-saml-sso/pull/173?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pressbooks) ```diff @@ Coverage Diff @@ ## dev #173 +/- ## ============================================ + Coverage 87.69% 87.84% +0.14% Complexity 189 189 ============================================ Files 3 3 Lines 626 625 -1 ============================================ Hits 549 549 + Misses 77 76 -1 ``` | [Impacted Files](https://app.codecov.io/gh/pressbooks/pressbooks-saml-sso/pull/173?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pressbooks) | Coverage Δ | | |---|---|---| | [inc/class-saml.php](https://app.codecov.io/gh/pressbooks/pressbooks-saml-sso/pull/173?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pressbooks#diff-aW5jL2NsYXNzLXNhbWwucGhw) | `88.00% <ø> (+0.16%)` | :arrow_up: | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/pressbooks/pressbooks-saml-sso/pull/173?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pressbooks). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pressbooks) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/pressbooks/pressbooks-saml-sso/pull/173?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pressbooks). Last update [ff5d7b3...a4a7c26](https://app.codecov.io/gh/pressbooks/pressbooks-saml-sso/pull/173?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pressbooks). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pressbooks).