headplane/app/routes/users/components/oidc.tsx

51 lines
1.6 KiB
TypeScript
Raw Normal View History

2024-12-31 10:30:14 +05:30
import { OrganizationIcon, PasskeyFillIcon } from '@primer/octicons-react';
2024-05-15 21:52:19 -04:00
2024-12-31 10:30:14 +05:30
import Card from '~/components/Card';
import Link from '~/components/Link';
2024-12-31 10:31:50 +05:30
import type { HeadplaneContext } from '~/utils/config/headplane';
2024-05-15 21:52:19 -04:00
2024-12-31 10:30:14 +05:30
import Add from '../dialogs/add';
2024-05-15 21:52:19 -04:00
interface Props {
2024-12-31 10:30:14 +05:30
readonly oidc: NonNullable<HeadplaneContext['oidc']>;
readonly magic: string | undefined;
2024-05-15 21:52:19 -04:00
}
export default function Oidc({ oidc, magic }: Props) {
return (
<Card variant="flat" className="mb-8 w-full max-w-full p-0">
<div className="flex flex-col md:flex-row">
<div className="w-full p-4 border-b md:border-b-0 border-ui-200 dark:border-ui-700">
<OrganizationIcon className="w-5 h-5 mb-2" />
2024-12-31 10:30:14 +05:30
<h2 className="font-medium mb-1">OpenID Connect</h2>
2024-05-15 21:52:19 -04:00
<p className="text-sm text-ui-600 dark:text-ui-300">
2024-12-31 10:30:14 +05:30
Users are managed through your{' '}
2024-05-15 21:52:19 -04:00
<Link to={oidc.issuer} name="OIDC Provider">
OpenID Connect provider
</Link>
{'. '}
2024-12-31 10:30:14 +05:30
Groups and user information do not automatically sync.{' '}
2024-05-15 21:52:19 -04:00
<Link
to="https://headscale.net/stable/ref/oidc"
2024-05-15 21:52:19 -04:00
name="Headscale OIDC Documentation"
>
Learn more
</Link>
</p>
</div>
<div className="w-full p-4 md:border-l border-ui-200 dark:border-ui-700">
<PasskeyFillIcon className="w-5 h-5 mb-2" />
2024-12-31 10:30:14 +05:30
<h2 className="font-medium mb-1">User Management</h2>
2024-05-15 21:52:19 -04:00
<p className="text-sm text-ui-600 dark:text-ui-300">
2024-12-31 10:30:14 +05:30
You can still add users manually, however it is recommended that you
manage users through your OIDC provider.
2024-05-15 21:52:19 -04:00
</p>
<div className="flex items-center gap-2 mt-4">
<Add />
2024-05-15 21:52:19 -04:00
</div>
</div>
</div>
</Card>
2024-12-31 10:30:14 +05:30
);
2024-05-15 21:52:19 -04:00
}