Files
supabase/apps/studio/pages/api/get-utc-time.ts
Ivan Vasilov b5437c630e feat: Add a banner for clock skew in studio (#32866)
* Add a ClockSkewBanner on top of studio.

* Fix the color of the RestrictionBanner.

* Add an API endpoint which return the current UTC time on the server.

* Fix the glob pattern for docs in turbo.json.

* Force docs to build.

* Revert unneeded changes.

* Add feature flag for clock skew banner.

* Add a comment.
2025-01-21 17:45:06 +01:00

12 lines
394 B
TypeScript

import { NextApiRequest, NextApiResponse } from 'next'
// Returns the current UTC time in ISO format. Used to check if the client and server time are skewed. Clock skew causes
// issues with JWT verification.
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
const utcTime = new Date().toISOString()
return res.status(200).json({ utcTime })
}
export default handler