Skip to main content

isUserAuthorized()

function isUserAuthorized(): boolean;

Checks if the user is currently authorized/authenticated.

Returns

boolean

true if user has a valid authorization header, false otherwise

Example

if (isUserAuthorized()) {
// User is logged in
}