UNPKG

@accounts/express-session

Version:

Stores the access and refresh tokens as part of the session (`express-session`), this way auth flow could be based on it.

11 lines (9 loc) 317 B
import type { Request } from 'express'; export const getUserAgent = (req: Request) => { let userAgent: string = (req.headers['user-agent'] as string) || ''; if (req.headers['x-ucbrowser-ua']) { // special case of UC Browser userAgent = req.headers['x-ucbrowser-ua'] as string; } return userAgent; };