Skip to content

Instantly share code, notes, and snippets.

View Itrulia's full-sized avatar

Itrulia Itrulia

  • We.Publish
  • Zuerich, Switzerland
View GitHub Profile
View gist:7ece3eacac1fd0ba7fc6b6bedb9c55fe
import {UserSession, User} from '@wepublish/website/api'
import {useRouter} from 'next/router'
import {createContext, Dispatch, SetStateAction, useContext} from 'react'
export const AuthTokenStorageKey = 'auth.token'
export const SessionTokenContext = createContext<
[User | null, Dispatch<SetStateAction<UserSession | null>>]
>(null!)