Authentication Styling
The integrations provide a CSS class to easily assess whether the current user is authenticated (logged in) or unauthenticated (logged out). If a user is authenticated the MT_authenticated
class will be added to the root element of the page. Alternatively, if a user is unauthenticated the MT_unauthenticated
class will be added to the root element of the page.
This enables you to hide or show any sections of your site based upon a user's state.
Authentication utility classes
We provide some helpful utility classes to hide or show sections or your site based upon a user's authentication status. Add the class MT_authenticated-block
to a section you only want authenticated users to see or add MT_unauthenticated-block
to a section you only want unauthenticated users to see.
<div class="MT_authenticated-block">
Something only visible to authenticated users.
</div>
<div class="MT_unauthenticated-block">
Something only visible to unauthenticated users.
</div>