PassageAuthGuard
Protects content by requiring a logged in user to view the content.
A component can be passed in which will render when the user has not been authenticated. The default is to render null.
src/login.tsx
import React from 'react';
import { PassageAuthGuard } from '@passageidentity/passage-react';
export const ProtectedPage: React.FC = () => {
return (
<PassageAuthGuard>
<p>Protected content</p>
</PassageAuthGuard>
);
};
Props
Name | Required | Type | Description |
---|---|---|---|
unAuthComp | No | React.ReactNode | Component to render if the user is not authenticated |