Extract admin dashboard from ghabilee-frontend2 into a dedicated Next.js app for backoffice.ghabilee.ir (no SEO indexing / Clarity).
15 lines
492 B
TypeScript
15 lines
492 B
TypeScript
import Cookies from 'js-cookie'
|
|
|
|
/**
|
|
* Synchronous client-only hint that a consumer session likely exists.
|
|
* Used to suppress guest marketing / nationwide feed flash before AuthContext
|
|
* finishes hydrating from localStorage (CLS on `/`).
|
|
*
|
|
* Returns false during SSR — guest ISR HTML stays unchanged.
|
|
*/
|
|
export function hasClientSessionHint(): boolean {
|
|
if (typeof window === 'undefined') return false
|
|
|
|
return Boolean(Cookies.get('accessToken') || localStorage.getItem('user'))
|
|
}
|