useTrixtaAuth
A react hook that will return authentication and authorization info.
import { useTrixtaAuth } from '@trixtateam/trixta-js-core';
const {
isAuthenticated,
hasRole,
hasAccess,
isAuthorizing
} = useTrixtaAuth({ roleName });
Options
roleName : string?Optional
Trixta role name
Returns
isAuthenticated : booleanWill be
trueif the Trixta space connected with token parameter.
hasRole : booleanWill be
trueif the passedroleNamefor the current user has access.
hasAccess : booleanWill be
trueif thehasRoleandisAuthenticatedmentioned above istrue.
isAuthorizing : booleanWill be
trueif Trixta is still authorizing the above mentionedroleName
Last updated
Was this helpful?