mirror of
https://github.com/plankanban/planka.git
synced 2025-07-19 05:09:43 +02:00
feat: OIDC with PKCE flow (#491)
This commit is contained in:
parent
e254443272
commit
6941500c7b
24 changed files with 805 additions and 22 deletions
19
client/src/components/OIDC/OidcLogin.jsx
Normal file
19
client/src/components/OIDC/OidcLogin.jsx
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { useAuth } from 'react-oidc-context';
|
||||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
|
||||
let isLoggingIn = true;
|
||||
const OidcLogin = React.memo(({ onAuthenticate }) => {
|
||||
const auth = useAuth();
|
||||
if (isLoggingIn && auth.user) {
|
||||
isLoggingIn = false;
|
||||
const { user } = auth;
|
||||
onAuthenticate(user);
|
||||
}
|
||||
});
|
||||
|
||||
OidcLogin.propTypes = {
|
||||
onAuthenticate: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export default OidcLogin;
|
Loading…
Add table
Add a link
Reference in a new issue