MCPcopy Create free account
hub / github.com/pacexy/flow / handler

Function handler

apps/reader/src/pages/api/refresh.ts:7–23  ·  view source on GitHub ↗
(
  req: NextApiRequest,
  res: NextApiResponse,
)

Source from the content-addressed store, hash-verified

5import { dbx } from './utils'
6
7export default async function handler(
8 req: NextApiRequest,
9 res: NextApiResponse,
10) {
11 const token = req.cookies[mapToToken['dropbox']]
12 if (typeof token !== 'string') {
13 return res.status(401).end()
14 }
15
16 dbx.auth.setRefreshToken(token)
17 await dbx.auth.refreshAccessToken()
18
19 res.json({
20 accessToken: dbx.auth.getAccessToken(),
21 accessTokenExpiresAt: dbx.auth.getAccessTokenExpiresAt(),
22 })
23}

Callers

nothing calls this directly

Calls 1

statusMethod · 0.80

Tested by

no test coverage detected