mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 21:19:13 +00:00
Don't remove the oauth state on polling the status of the auth request (#663)
* Fix unused ?. * Don't remove the state from the tokenStore when polling * changelog
This commit is contained in:
parent
e6f51bf2de
commit
7f34d69cfa
1
changelog.d/663.bugfix
Normal file
1
changelog.d/663.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Fix GitHub OAuth button causing a "Could not find user which authorised this request" error .
|
@ -190,7 +190,7 @@ export class Webhooks extends EventEmitter {
|
||||
const oauthUrl = this.config.widgets && new URL("oauth.html", this.config.widgets.parsedPublicUrl);
|
||||
if (oauthUrl) {
|
||||
oauthUrl.searchParams.set('service', 'github');
|
||||
oauthUrl?.searchParams.set('oauth-kind', 'account');
|
||||
oauthUrl.searchParams.set('oauth-kind', 'account');
|
||||
}
|
||||
const { setup_action, state } = req.query;
|
||||
log.info("Got new oauth request", { state, setup_action });
|
||||
|
@ -333,7 +333,7 @@ export class BridgeWidgetApi {
|
||||
}
|
||||
|
||||
// N.B. Service isn't really used.
|
||||
const stateUserId = this.tokenStore.getUserIdForOAuthState(state);
|
||||
const stateUserId = this.tokenStore.getUserIdForOAuthState(state, false);
|
||||
|
||||
if (!stateUserId || req.userId !== stateUserId) {
|
||||
// If the state isn't found then either the state has been completed or the key is wrong.
|
||||
|
Loading…
x
Reference in New Issue
Block a user