zorn-v / nextcloud-social-login

GNU Affero General Public License v3.0
198 stars 137 forks source link

Clear invalid authorization_state during OAuth login #398

Closed kousu closed 10 months ago

kousu commented 1 year ago

Fixes https://github.com/zorn-v/nextcloud-social-login/issues/386 , maybe.

kousu commented 1 year ago

I'm going to run for a while with this and see if I get any more reports of #386 from my org. I'll report back!

kousu commented 1 year ago

(and of course if it works here I'll upstream it to HybridAuth) EDIT: https://github.com/hybridauth/hybridauth/pull/1382

kousu commented 1 year ago

I saw the error again today, but I forgot to test if just reloading would make it work. Because how I think this patch should work is, it will still fail once, but on retrying it should work.

kousu commented 10 months ago

I've been running this patch for months and haven't had any complaints nor have I seen "The authorization state [state=HA-xxxxxxxxxxx] of this page is either invalid or has already been consumed" since that one time in March. That one time in March may have simply been a fluke due to some extra-inconsistent cookie state on my dev machine. For everyone else (and me, really), I am confident it improves stability.

kousu commented 10 months ago

This was merged by upstream in https://github.com/hybridauth/hybridauth/pull/1382; so when you update your version of HybridAuth you should get the fix.

I'll close.