summaryrefslogtreecommitdiff
path: root/examples/ssr/src/models/user.ts
blob: a2812a8addc30b14fa6529853cd851e9de484b56 (plain) (blame)
1
2
3
4
5
6
7
import lightcookie from 'lightcookie';

export function isLoggedIn(request: Request): boolean {
	const cookie = request.headers.get('cookie');
	const parsed = lightcookie.parse(cookie);
	return 'user-id' in parsed;
}