PassageUnAuthGuard
The opposite of PassageAuthGuard ensures a user is NOT authenticated to view the content.
A component can be passed in which will render when the user is authenticated. The default is to render null.
src/login.tsx
import React from 'react';
import { PassageUnAuthGuard } from '@passageidentity/passage-react';
export const UnAuthOnlyPage: React.FC = () => {
return (
<PassageUnAuthGuard>
<p>Protected content</p>
</PassageUnAuthGuard>
);
};
Props
Name | Required | Type | Description |
---|---|---|---|
authComp | No | React.ReactNode | Component to render if the user is authenticated |