Skip to main content

Module: hooks/useSCAuth

Functions

useAuth

useAuth(initialSession): Object

info

This component is used to navigate through the application.

Usage

In order to use router you need to import this components first:

import {SCRoutingContextType, useSCRouting, Link, SCRoutes} from '@selfcommunity/react-core';
Usage Example:
const scRoutingContext: SCRoutingContextType = useSCRouting();
<Button component={Link} to={scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, {id: user.id})>Go to profile</Button>

or

const scRoutingContext: SCRoutingContextType = useSCRouting();
<Link to={scRoutingContext.url('profile', {id: user.id})}>Go to profile</Link>

Parameters

NameType
initialSessionSCSessionType

Returns

Object

NameType
dispatchDispatch<any>
helpers{ logoutSession: () => void ; refreshSession: () => Promise<SCAuthTokenType> }
helpers.logoutSession() => void
helpers.refreshSession() => Promise<SCAuthTokenType>
stateany

Defined in

packages/react-core/src/hooks/useSCAuth.ts:145