1
0
mirror of synced 2025-12-31 06:02:42 -05:00
Files
docs/middleware/api/session.js
Kevin Heis 04f38e4779 Parse color_mode cookie in browser (#29738)
* Parse color_mode cookie in browser

* Update useTheme.ts

* Update use-theme.js

* Update use-theme.js

* Add support for dark_high_contrast

Per https://primer.style/css/support/theming

I also checked all the color mode options, this is the only additional working with Primer 20 so far

* Remove gray bg

* Remove  type

* Use defaults instead of types for fn args

* Thicker types
2022-08-09 16:48:18 +00:00

17 lines
393 B
JavaScript

import express from 'express'
import { cacheControlFactory } from '../cache-control.js'
const router = express.Router()
const noCacheControl = cacheControlFactory(0)
router.get('/', (req, res) => {
noCacheControl(res)
res.json({
isSignedIn: Boolean(req.cookies?.dotcom_user),
csrfToken: req.csrfToken?.() || '',
userLanguage: req.userLanguage,
})
})
export default router