mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
feat: Ability to automatically initiate OIDC authentication (#1092)
Closes #1091
This commit is contained in:
parent
1f7b040fe5
commit
26bccd55a8
2 changed files with 23 additions and 8 deletions
|
@ -159,7 +159,6 @@ const Login = React.memo(
|
||||||
<div>
|
<div>
|
||||||
{message && (
|
{message && (
|
||||||
<Message
|
<Message
|
||||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
||||||
{...{
|
{...{
|
||||||
[message.type]: true,
|
[message.type]: true,
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { call, put, select, take } from 'redux-saga/effects';
|
import { call, put, select, take } from 'redux-saga/effects';
|
||||||
import { push } from '../../../lib/redux-router';
|
import { push } from '../../../lib/redux-router';
|
||||||
|
|
||||||
import { authenticateUsingOidcCallback } from './login';
|
import { authenticateUsingOidc, authenticateUsingOidcCallback } from './login';
|
||||||
import selectors from '../../../selectors';
|
import selectors from '../../../selectors';
|
||||||
import ActionTypes from '../../../constants/ActionTypes';
|
import ActionTypes from '../../../constants/ActionTypes';
|
||||||
import Paths from '../../../constants/Paths';
|
import Paths from '../../../constants/Paths';
|
||||||
|
@ -29,17 +29,33 @@ export function* handleLocationChange() {
|
||||||
yield call(goToLogin);
|
yield call(goToLogin);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case Paths.OIDC_CALLBACK: {
|
default:
|
||||||
const isInitializing = yield select(selectors.selectIsInitializing);
|
}
|
||||||
|
|
||||||
if (isInitializing) {
|
const isInitializing = yield select(selectors.selectIsInitializing);
|
||||||
yield take(ActionTypes.LOGIN_INITIALIZE);
|
|
||||||
|
if (isInitializing) {
|
||||||
|
yield take(ActionTypes.LOGIN_INITIALIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (pathsMatch.pattern.path) {
|
||||||
|
case Paths.LOGIN: {
|
||||||
|
const oidcConfig = yield select(selectors.selectOidcConfig);
|
||||||
|
|
||||||
|
if (oidcConfig) {
|
||||||
|
const params = new URLSearchParams(window.location.search);
|
||||||
|
|
||||||
|
if (params.has('authenticateWithOidc')) {
|
||||||
|
yield call(authenticateUsingOidc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
yield call(authenticateUsingOidcCallback);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case Paths.OIDC_CALLBACK:
|
||||||
|
yield call(authenticateUsingOidcCallback);
|
||||||
|
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue