mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 11:17:49 +01:00
Add OAuth2 authentication (#147)
- Added Site settings > Authentication section - Create/edit/delete your custom oauth2 configurations - Login or signup with oauth2
This commit is contained in:
committed by
GitHub
parent
3bda6dee08
commit
4c73b398e8
@@ -0,0 +1,53 @@
|
||||
import * as React from 'react';
|
||||
import I18n from 'i18n-js';
|
||||
|
||||
import Box from '../../common/Box';
|
||||
import OAuthProvidersList from './OAuthProvidersList';
|
||||
import { AuthenticationPages } from './AuthenticationSiteSettingsP';
|
||||
import { OAuthsState } from '../../../reducers/oAuthsReducer';
|
||||
import SiteSettingsInfoBox from '../../common/SiteSettingsInfoBox';
|
||||
|
||||
interface Props {
|
||||
oAuths: OAuthsState;
|
||||
isSubmitting: boolean;
|
||||
submitError: string;
|
||||
|
||||
handleToggleEnabledOAuth(id: number, enabled: boolean): void;
|
||||
handleDeleteOAuth(id: number): void;
|
||||
|
||||
setPage: React.Dispatch<React.SetStateAction<AuthenticationPages>>;
|
||||
setSelectedOAuth: React.Dispatch<React.SetStateAction<number>>;
|
||||
}
|
||||
|
||||
const AuthenticationIndexPage = ({
|
||||
oAuths,
|
||||
isSubmitting,
|
||||
submitError,
|
||||
|
||||
handleToggleEnabledOAuth,
|
||||
handleDeleteOAuth,
|
||||
|
||||
setPage,
|
||||
setSelectedOAuth,
|
||||
}: Props) => (
|
||||
<>
|
||||
<Box customClass="authenticationIndexPage">
|
||||
<h2>{ I18n.t('site_settings.authentication.title') }</h2>
|
||||
|
||||
<OAuthProvidersList
|
||||
oAuths={oAuths.items}
|
||||
handleToggleEnabledOAuth={handleToggleEnabledOAuth}
|
||||
handleDeleteOAuth={handleDeleteOAuth}
|
||||
setPage={setPage}
|
||||
setSelectedOAuth={setSelectedOAuth}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
<SiteSettingsInfoBox
|
||||
areUpdating={oAuths.areLoading || isSubmitting}
|
||||
error={oAuths.error || submitError}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
export default AuthenticationIndexPage;
|
||||
Reference in New Issue
Block a user