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
...and is being set with the authentication attempt in Tab A, then overwritten by the authentication attempt in Tab B. When Tab A returns, it unfortunately uses that return url stored by tab B:
valredirect= request.session.get(GoogleAuthFilters.LOGIN_ORIGIN_KEY) match {
caseSome(url) =>Redirect(url)
caseNone=>Redirect(defaultRedirectTarget)
}
Proposed Fix
Instead of storing the return url in the Play session, it could be stored in the state of the OAuth authentication request - ie in the JWT token introduced with #52.
The return url should probably be encrypted to avoid return urls leaking to Google servers.
The text was updated successfully, but these errors were encountered:
Steps to reproduce bug
Choose an account to continue to ophan.co.uk
messageguardian.co.uk
account) in tab A.Expected behaviour
Tab A is redirected to https://dashboard.ophan.co.uk/ - which is where the user was trying to go in that tab before the authentication happened.
Actual behaviour
Tab A is redirected to https://dashboard.ophan.co.uk/heatmap/filter-bar?path=/uk&# on completing authentication, and it looks like a mess:
Cause
The return url is stored in the Play session:
play-googleauth/module/src/main/scala/com/gu/googleauth/actions.scala
Lines 83 to 86 in 7582a32
...and is being set with the authentication attempt in Tab A, then overwritten by the authentication attempt in Tab B. When Tab A returns, it unfortunately uses that return url stored by tab B:
play-googleauth/module/src/main/scala/com/gu/googleauth/actions.scala
Lines 197 to 201 in 7582a32
Proposed Fix
Instead of storing the return url in the Play session, it could be stored in the
state
of the OAuth authentication request - ie in the JWT token introduced with #52.The return url should probably be encrypted to avoid return urls leaking to Google servers.
The text was updated successfully, but these errors were encountered: