mirror of
https://github.com/rybbit-io/rybbit.git
synced 2025-05-10 11:55:37 +02:00
Fix callbacks (#107)
* Fix callbacks * fix layout * Remove callbacks * Disable redirects * fix caddy * test disable basepath * wip * test caddy fix * remove basepath * fml * pray * kms * pray * wip * Test
This commit is contained in:
parent
dd3739a716
commit
97c29dafac
7 changed files with 16 additions and 14 deletions
|
@ -4,21 +4,14 @@
|
|||
# Enable compression
|
||||
encode zstd gzip
|
||||
|
||||
# Proxy API requests to the backend service
|
||||
handle_path /api/* {
|
||||
reverse_proxy backend:3001
|
||||
}
|
||||
|
||||
|
||||
# Proxy all other requests to the client service
|
||||
handle {
|
||||
reverse_proxy client:3002
|
||||
}
|
||||
|
||||
# Optional: Add security headers (example)
|
||||
# header {
|
||||
# Strict-Transport-Security max-age=31536000;
|
||||
# X-Content-Type-Options nosniff
|
||||
# X-Frame-Options DENY
|
||||
# Referrer-Policy strict-origin-when-cross-origin
|
||||
# }
|
||||
}
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
import { BACKEND_URL } from "@/lib/const";
|
||||
import QueryProvider from "@/providers/QueryProvider";
|
||||
import type { Metadata } from "next";
|
||||
import { Inter, Manrope } from "next/font/google";
|
||||
import { Inter } from "next/font/google";
|
||||
import { redirect, usePathname } from "next/navigation";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Toaster } from "../components/ui/sonner";
|
||||
|
|
|
@ -54,7 +54,6 @@ export default function Page() {
|
|||
try {
|
||||
await authClient.signIn.social({
|
||||
provider,
|
||||
callbackURL: "/",
|
||||
});
|
||||
} catch (error) {
|
||||
setError(String(error));
|
||||
|
|
|
@ -255,7 +255,6 @@ export default function SignupPage() {
|
|||
onClick={() => {
|
||||
authClient.signIn.social({
|
||||
provider: "google",
|
||||
callbackURL: "/",
|
||||
});
|
||||
}}
|
||||
className="transition-all duration-300 hover:bg-muted bg-neutral-800/50 border-neutral-700"
|
||||
|
@ -269,7 +268,6 @@ export default function SignupPage() {
|
|||
onClick={() => {
|
||||
authClient.signIn.social({
|
||||
provider: "github",
|
||||
callbackURL: "/",
|
||||
});
|
||||
}}
|
||||
className="transition-all duration-300 hover:bg-muted bg-neutral-800/50 border-neutral-700"
|
||||
|
|
|
@ -10,6 +10,17 @@ export async function middleware(request: NextRequest) {
|
|||
return NextResponse.next();
|
||||
}
|
||||
|
||||
// Handle GitHub OAuth callback redirect
|
||||
if (path === "/auth/callback/github" || path === "/auth/callback/google") {
|
||||
const redirectUrl = new URL(
|
||||
`/api${path}${request.nextUrl.search}`,
|
||||
request.url
|
||||
);
|
||||
const response = NextResponse.redirect(redirectUrl);
|
||||
response.headers.set("Cache-Control", "no-store, max-age=0");
|
||||
return response;
|
||||
}
|
||||
|
||||
// Check if we're on a site route without a specific page
|
||||
// This matches exactly /{siteId} with nothing after it
|
||||
const siteRoutePattern = /^\/([^/]+)$/;
|
||||
|
|
|
@ -121,6 +121,8 @@ const PUBLIC_ROUTES: string[] = [
|
|||
"/script",
|
||||
"/auth",
|
||||
"/api/auth",
|
||||
"/api/auth/callback/google",
|
||||
"/api/auth/callback/github",
|
||||
"/api/stripe/webhook", // Add webhook to public routes
|
||||
];
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import { eq } from "drizzle-orm";
|
|||
import pg from "pg";
|
||||
import { db } from "../db/postgres/postgres.js";
|
||||
import * as schema from "../db/postgres/schema.js";
|
||||
import { DISABLE_SIGNUP } from "./const.js";
|
||||
import { DISABLE_SIGNUP, IS_CLOUD } from "./const.js";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue