Optional
returnwithAuthenticationRequired(Profile, {
returnTo: '/profile'
})
or
withAuthenticationRequired(Profile, {
returnTo: () => window.location.hash.substr(1)
})
Add a path for the onRedirectCallback
handler to return the user to after login.
Optional
onwithAuthenticationRequired(Profile, {
onRedirecting: () => <div>Redirecting you to the login...</div>
})
Render a message to show that the user is being redirected to the login.
Optional
onwithAuthenticationRequired(Profile, {
onBeforeAuthentication: () => { analyticsLibrary.track('login_triggered'); }
})
Allows executing logic before the user is redirected to the login page.
Optional
loginwithAuthenticationRequired(Profile, {
loginOptions: {
appState: {
customProp: 'foo'
}
}
})
Pass additional login options, like extra appState
to the login page.
This will be merged with the returnTo
option used by the onRedirectCallback
handler.
Optional
contextThe context to be used when calling useFort, this should only be provided if you are using multiple FortProviders within your application and you wish to tie a specific component to a FortProvider other than the FortProvider associated with the default FortContext.
Options for the withAuthenticationRequired Higher Order Component