configure for subdomain
Gitea/subman-nextjs/pipeline/head This commit looks good
Details
Gitea/subman-nextjs/pipeline/head This commit looks good
Details
This commit is contained in:
parent
5fb913b6a3
commit
4716264483
|
@ -1,7 +1,7 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
output: "standalone",
|
||||
// basePath: "/subman",
|
||||
basePath: "/subman",
|
||||
webpack: (config) => {
|
||||
config.externals = [...config.externals, "bcrypt"];
|
||||
return config;
|
||||
|
|
|
@ -17,7 +17,7 @@ export default async function(request: NextRequest): Promise<NextResponse> | und
|
|||
|
||||
|
||||
const url = request.nextUrl.clone()
|
||||
url.pathname = "subman/login"
|
||||
url.pathname = "/login"
|
||||
url.searchParams.set('from', request.nextUrl.pathname)
|
||||
if (protectedRoutes.some(pattern => matchesWildcard(request.nextUrl.pathname, pattern))) {
|
||||
const token = request.cookies.get('token')
|
||||
|
@ -47,7 +47,7 @@ export default async function(request: NextRequest): Promise<NextResponse> | und
|
|||
//TODO - TEST THIS BECAUSE IT PROBABLY DOESN'T WORK
|
||||
//redirect from login if already logged in
|
||||
let redirectToApp = false
|
||||
if (request.nextUrl.pathname === "subman/login") {
|
||||
if (request.nextUrl.pathname === "/login") {
|
||||
const token = request.cookies.get("token")
|
||||
if (token) {
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue