aboutsummaryrefslogtreecommitdiff
path: root/src/proxy.ts
diff options
context:
space:
mode:
authorschererleander <leander@schererleander.de>2025-12-26 18:08:48 +0100
committerschererleander <leander@schererleander.de>2025-12-26 18:08:48 +0100
commitad7b4f1ab0b3ef2f71e9a70078716aed50cdbf64 (patch)
tree944f78aeb0364e962b84c98ea6bb236072413656 /src/proxy.ts
parenta23753f65272dca3f0b54bed16d96512a3cbe20d (diff)
feat(auth): add two-factor authentication support
Diffstat (limited to 'src/proxy.ts')
-rw-r--r--src/proxy.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/proxy.ts b/src/proxy.ts
new file mode 100644
index 0000000..796acfa
--- /dev/null
+++ b/src/proxy.ts
@@ -0,0 +1,15 @@
+import { withAuth } from "next-auth/middleware"
+
+export default withAuth({
+ callbacks: {
+ authorized: ({ token }) => !!token,
+ },
+})
+
+export const config = {
+ matcher: [
+ "/settings/:path*",
+ "/dashboard/:path*",
+ "/api/user/:path*"
+ ]
+}