hathitrust / firebird-common

Other
0 stars 0 forks source link

DEV-925: update switch role link #48

Closed carylwyatt closed 1 year ago

carylwyatt commented 1 year ago

Problem

When in catalog (or website), if user chooses to switch roles via the navbar login/account button, the user is sent back to the website homepage instead of the page they were on.

Fix

/components/Navbar/index.js (line 434)

 href="//{`${
                          HT.service_domain
                        }/cgi/ping/switch?target=${encodeURIComponent(
                          window.location.href
                        )}`}"

I borrowed the code from Roger's logout redirect just below this in the same file.

babel-local-dev doesn't have ping (or at least mine doesn't), so I tested this on https://dev-3.catalog.hathitrust.org/Search/Home

Test it

Conduct search, open catalog record, log in and switch role to CAA-- you should be redirected back to the page you were on.

netlify[bot] commented 1 year ago

Deploy Preview for hathitrust-firebird-common ready!

Name Link
Latest commit e5c7b22a27f85e517c23b4098f7fffbf2a0f6d87
Latest deploy log https://app.netlify.com/sites/hathitrust-firebird-common/deploys/650b46aa62c2000008ee923e
Deploy Preview https://deploy-preview-48--hathitrust-firebird-common.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.