/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
examples/with-magic/pages/api/user.js
9 строк
387 B
Steven
chore(examples): use default prettier for examples/templates (#60530)
12 янв 2024, 02:01
Не верифицирован
12 янв 2024, 02:01
4466ba4
Код
Авторство
О чём код?
import { getLoginSession } from "../../lib/auth"; export default async function user(req, res) { const session = await getLoginSession(req); // After getting the session you may want to fetch for the user instead // of sending the session's payload directly, this example doesn't have a DB // so it won't matter in this case res.status(200).json({ user: session || null }); }