protected()
The Protected component enhances security by restricting access to authorized users, safeguarding sensitive content visibility for authenticated users.
Example:
import { Protected } from '@magicjs.dev/frontend';
return (
<Protected>
<div>This is protected content.</div>
</Protected>
);
In this example, the content enclosed within the component is rendered exclusively for authenticated users. If a user lacks authentication, the content remains invisible.
Last updated