Skip to content

Commit bbee5bc

Browse files
committed
πŸ›‚ server: setup csrf protection
1 parent 69c59b6 commit bbee5bc

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@exactly/server": patch
3+
---
4+
5+
πŸ›‚ setup csrf protection

β€Žserver/api/index.tsβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Hono } from "hono";
22
import { cors } from "hono/cors";
3+
import { csrf } from "hono/csrf";
34

45
import activity from "./activity";
56
import authentication from "./auth/authentication";
@@ -11,6 +12,7 @@ import appOrigin from "../utils/appOrigin";
1112

1213
const api = new Hono()
1314
.use(cors({ origin: appOrigin, credentials: true }))
15+
.use(csrf({ origin: appOrigin }))
1416
.route("/auth/registration", registration)
1517
.route("/auth/authentication", authentication)
1618
.route("/activity", activity)

0 commit comments

Comments
Β (0)