-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 fix: fix dayjs error in en-US language (#3604)
* 🐛 fix: fix dayjs issue * 🐛 fix: fix user auth and password issue
- Loading branch information
Showing
5 changed files
with
30 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { TRPCError } from '@trpc/server'; | ||
|
||
import { getJWTPayload } from '@/app/api/middleware/auth/utils'; | ||
import { trpc } from '@/libs/trpc/init'; | ||
|
||
export const jwtPayloadChecker = trpc.middleware(async (opts) => { | ||
const { ctx } = opts; | ||
|
||
if (!ctx.authorizationHeader) throw new TRPCError({ code: 'UNAUTHORIZED' }); | ||
|
||
const jwtPayload = await getJWTPayload(ctx.authorizationHeader); | ||
|
||
return opts.next({ ctx: { jwtPayload } }); | ||
}); |
This file was deleted.
Oops, something went wrong.