set base url
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
0bade3c1c9
commit
8995047aa5
|
@ -1,6 +1,7 @@
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
output: "standalone",
|
output: "standalone",
|
||||||
|
basePath: "/subman",
|
||||||
webpack: (config) => {
|
webpack: (config) => {
|
||||||
config.externals = [...config.externals, "bcrypt"];
|
config.externals = [...config.externals, "bcrypt"];
|
||||||
return config;
|
return config;
|
||||||
|
|
|
@ -17,7 +17,7 @@ export default async function(request: NextRequest): Promise<NextResponse> | und
|
||||||
|
|
||||||
|
|
||||||
const url = request.nextUrl.clone()
|
const url = request.nextUrl.clone()
|
||||||
url.pathname = "/login"
|
url.pathname = "subman/login"
|
||||||
url.searchParams.set('from', request.nextUrl.pathname)
|
url.searchParams.set('from', request.nextUrl.pathname)
|
||||||
if (protectedRoutes.some(pattern => matchesWildcard(request.nextUrl.pathname, pattern))) {
|
if (protectedRoutes.some(pattern => matchesWildcard(request.nextUrl.pathname, pattern))) {
|
||||||
const token = request.cookies.get('token')
|
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
|
//TODO - TEST THIS BECAUSE IT PROBABLY DOESN'T WORK
|
||||||
//redirect from login if already logged in
|
//redirect from login if already logged in
|
||||||
let redirectToApp = false
|
let redirectToApp = false
|
||||||
if (request.nextUrl.pathname === "/login") {
|
if (request.nextUrl.pathname === "subman/login") {
|
||||||
const token = request.cookies.get("token")
|
const token = request.cookies.get("token")
|
||||||
if (token) {
|
if (token) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue