Download apps/backend-mock/api/auth/codes.ts from binhugg3/admin: direct link, hf CLI and curl.
- Browser
- Download file 401 Bytes
-
https://huggingface.co/spaces/binhugg3/admin/resolve/main/apps/backend-mock/api/auth/codes.ts
- Command line
-
hf download hf://spaces/binhugg3/admin/apps/backend-mock/api/auth/codes.ts
-
curl -L -o codes.ts https://huggingface.co/spaces/binhugg3/admin/resolve/main/apps/backend-mock/api/auth/codes.ts
401 Bytes
| import { verifyAccessToken } from '~/utils/jwt-utils'; | |
| import { unAuthorizedResponse } from '~/utils/response'; | |
| export default eventHandler((event) => { | |
| const userinfo = verifyAccessToken(event); | |
| if (!userinfo) { | |
| return unAuthorizedResponse(event); | |
| } | |
| const codes = | |
| MOCK_CODES.find((item) => item.username === userinfo.username)?.codes ?? []; | |
| return useResponseSuccess(codes); | |
| }); | |