From 650f80eacd7d75827ad3d09473047bc5e04a3f51 Mon Sep 17 00:00:00 2001 From: Simon Eisenmann Date: Mon, 2 Nov 2020 14:15:18 +0100 Subject: [PATCH] Fix processing for prompt select_account with consent Multiple prompt values are allowed and this change fixes the check for select_account if it was used together with other prompt values. Where select_account previously was ignored, it is now processed as required, fixing the use case when a RP wants to trigger select_account first while at the same time wants also to request interactive consent. --- changelog/unreleased/konnectd-switchacc-consent.md | 9 +++++++++ konnectd/ui/src/containers/Login/Login.js | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/konnectd-switchacc-consent.md diff --git a/changelog/unreleased/konnectd-switchacc-consent.md b/changelog/unreleased/konnectd-switchacc-consent.md new file mode 100644 index 00000000000..40ccc5af0be --- /dev/null +++ b/changelog/unreleased/konnectd-switchacc-consent.md @@ -0,0 +1,9 @@ +Bugfix: Allow consent-prompt with switch-account + +Multiple prompt values are allowed and this change fixes the check for +select_account if it was used together with other prompt values. Where +select_account previously was ignored, it is now processed as required, +fixing the use case when a RP wants to trigger select_account first +while at the same time wants also to request interactive consent. + +https://github.com/owncloud/ocis/pull/788 diff --git a/konnectd/ui/src/containers/Login/Login.js b/konnectd/ui/src/containers/Login/Login.js index ae326bf7ef0..6005cfcf086 100644 --- a/konnectd/ui/src/containers/Login/Login.js +++ b/konnectd/ui/src/containers/Login/Login.js @@ -44,7 +44,7 @@ class Login extends React.PureComponent { componentDidMount() { const { hello, query, dispatch, history } = this.props; if (hello && hello.state && history.action !== 'PUSH') { - if (query.prompt !== 'select_account') { + if (!query.prompt || query.prompt.indexOf('select_account') == -1) { dispatch(advanceLogonFlow(true, history)); return; }