Skip to content

Commit

Permalink
chore: format code with Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 16, 2024
1 parent 012bb02 commit fc0537d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
3 changes: 1 addition & 2 deletions apps/api/app/api/[[...route]]/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import { Hono } from "hono";

const app = new Hono();


app.on(["POST", "GET"], "/**", (c) => {
return auth.handler(c.req.raw);
});

export default app
export default app;
5 changes: 1 addition & 4 deletions apps/api/app/api/[[...route]]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const allowedOrigins = [

export const runtime = "edge";

const app = new Hono<{
const app = new Hono<{
Variables: {
user: typeof Auth.$Infer.Session.user | null;
session: typeof Auth.$Infer.Session.session | null;
Expand Down Expand Up @@ -54,18 +54,15 @@ app.get("/health", async (c) => {
});
});


app.route("/session", session);
app.route("/hello", hello);
app.route("/mail", mail);
app.route("/auth", auth);


const GET = handle(app);
const POST = handle(app);
const PATCH = handle(app);
const DELETE = handle(app);
const OPTIONS = handle(app);

export { GET, PATCH, POST, DELETE, OPTIONS };

5 changes: 2 additions & 3 deletions apps/api/app/api/[[...route]]/session.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Hono } from "hono";
import { auth } from "@repo/auth";
const app = new Hono()
const app = new Hono();
app.get("/", async (c) => {
const session = await auth.api.getSession({ headers: c.req.raw.headers });
const session = await auth.api.getSession({ headers: c.req.raw.headers });

if (!session) return c.json({ message: "no session found" }, 401);

Expand All @@ -18,5 +18,4 @@ app.get("/all", async (c) => {
return c.json(res);
});


export default app;

0 comments on commit fc0537d

Please sign in to comment.