Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

user.js

16 lines312 Bytes

1// an endpoint for getting user info
2export default (req, res) => {
3 if (req.cookies['swr-test-token'] === 'swr') {
4 // authorized
5 res.json({
6 loggedIn: true,
7 name: 'Tanner',
8 avatar: 'https://github.com/tannerlinsley.png',
9 })
10 return
11 }
12​
13 res.json({
14 loggedIn: false,
15 })