We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.1.24
Mac
from 1.1.17 and Later errors that returns from resolve or derive are not parse and body is [object Object]
export const accountAuther = ({ IN, NOTIN, Ignore = false, }: { IN?: AccountType[]; NOTIN?: AccountType[]; Ignore?: boolean; }) => new Elysia().use(bearer()).resolve( { as: "scoped", }, async ({ error, bearer, set }) => { if (Ignore) { return error(404, { error: "Account not authorized", }); } set.headers["content-type"] = "application/json"; if (!bearer) { return error(404, { error: "Bearer token not found", }); } const dataFromAuth = verifyJWT(bearer); if (!dataFromAuth) { return error(404, { error: "Authorization key not valid", }); } const account = await validateAccount({ id: dataFromAuth.id, updatedAt: dataFromAuth.updatedAt, }); if (!account) return error(404, { error: "Account not found", }); if (IN && IN.length > 0 && !IN.includes(account.type)) { return error(401, { error: "Account not authorized", }); } if (NOTIN && NOTIN.length > 0 && NOTIN.includes(account.type)) { return error(401, { error: "Account not authorized", }); } // Check if account is banned if (account.accountState === AccountState.BLOCKED) { return error(403, { error: "Account is blocked", }); } return { account: account!, }; } );
No response
node_modules
bun.lockb
The text was updated successfully, but these errors were encountered:
yes, up
Sorry, something went wrong.
No branches or pull requests
What version of Elysia is running?
1.1.24
What platform is your computer?
Mac
What steps can reproduce the bug?
from 1.1.17 and Later errors that returns from resolve or derive are not parse and body is
[object Object]
What is the expected behavior?
No response
What do you see instead?
No response
Additional information
No response
Have you try removing the
node_modules
andbun.lockb
and try again yet?No response
The text was updated successfully, but these errors were encountered: