1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-24 15:49:46 +02:00

feat: OIDC with PKCE flow (#491)

This commit is contained in:
gorrilla10101 2023-09-04 10:06:59 -05:00 committed by GitHub
parent e254443272
commit 6941500c7b
24 changed files with 805 additions and 22 deletions

View file

@ -7,9 +7,13 @@ import { setAccessToken } from '../../../utils/access-token-storage';
export function* authenticate(data) {
yield put(actions.authenticate(data));
let accessToken;
let accessToken = data.access_token;
try {
({ item: accessToken } = yield call(api.createAccessToken, data));
if (accessToken) {
({ item: accessToken } = yield call(api.exchangeOidcToken, accessToken));
} else {
({ item: accessToken } = yield call(api.createAccessToken, data));
}
} catch (error) {
yield put(actions.authenticate.failure(error));
return;