Skip to content

Commit

Permalink
chore: rm unused dep
Browse files Browse the repository at this point in the history
  • Loading branch information
s99100532 committed Jun 22, 2024
1 parent d20abe9 commit 2828aa3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 47 deletions.
8 changes: 6 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"editor.defaultFormatter": "denoland.vscode-deno"
}
"deno.enable": true,
"prettier.enable": false,
"[typescript]": {
"editor.defaultFormatter": "denoland.vscode-deno"
}
}
1 change: 0 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"@oak/oak": "jsr:@oak/oak@^16.1.0",
"@std/assert": "jsr:@std/assert@^0.226.0",
"@std/csv": "jsr:@std/csv@^0.224.3",
"@std/dotenv": "jsr:@std/dotenv@^0.224.0",
"@std/log": "jsr:@std/log@^0.224.2",
"@std/testing": "jsr:@std/testing@^0.225.2",
"bcrypt": "https://deno.land/x/[email protected]/mod.ts",
Expand Down
42 changes: 1 addition & 41 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions middlewares.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Middleware } from "@oak/oak";
import helper from "./helpers.ts";
import { STATUS_CODE } from "jsr:@oak/[email protected]/status";
import { Status } from "@oak/oak";

export const authMiddleware: Middleware = async (ctx, next) => {
const auth = ctx.request.headers.get("Authorization");
Expand All @@ -16,11 +16,11 @@ export const authMiddleware: Middleware = async (ctx, next) => {
ctx.state.user_id = parseInt(payload.sub);
await next();
} catch (e) {
ctx.response.status = STATUS_CODE.Unauthorized;
ctx.response.status = Status.Unauthorized;
helper.setAPIResponse(ctx, { success: false, error_message: e.message });
}
} else {
ctx.response.status = STATUS_CODE.Unauthorized;
ctx.response.status = Status.Unauthorized;
helper.setAPIResponse(ctx, {
success: false,
error_message: "Unauthorized",
Expand Down

0 comments on commit 2828aa3

Please sign in to comment.