Skip to content

Commit

Permalink
Only send offline scope if refresh_token grant is available
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed May 19, 2024
1 parent cfd7d8a commit 9d20cdf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/ConnectForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,15 @@ export default {
await provider.login(this.username, this.password);
}
else if (authType === 'oidc') {
let offlineScope = true;
if (this.oidcClientId) {
this.provider.setClientId(this.oidcClientId);
}
await provider.login(this.oidcOptions, true);
else {
const client = provider.detectDefaultClient();
offlineScope = client && Array.isArray(client.grant_types) && client.grant_types.includes('refresh_token');
}
await provider.login(this.oidcOptions, offlineScope);
provider.addListener('AccessTokenExpired', () => Utils.warn(this, "User session has expired, please login again."));
provider.addListener('SilentRenewError', () => Utils.error(this, "You'll be switching to Guest mode in less than a minute.", "Session renewal failed"));
}
Expand Down

0 comments on commit 9d20cdf

Please sign in to comment.