improve setup and DB initialization
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
export default function ({ req, redirect, route }) {
|
||||
export default async function ({ $config, req, redirect, route, error }) {
|
||||
if (process.server) {
|
||||
if (req.firstrun && route.path !== '/setup') {
|
||||
return redirect('/setup')
|
||||
if (req.status === 'SETUP' && route.path !== '/setup/0') {
|
||||
return redirect('/setup/0')
|
||||
}
|
||||
if (!req.firstrun && route.path === '/setup') {
|
||||
|
||||
if (req.status === 'DBCONF' && route.path !== '/setup/1') {
|
||||
return redirect('/setup/1')
|
||||
}
|
||||
|
||||
if (req.status === 'READY' && route.path.startsWith('/setup')) {
|
||||
return redirect('/')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user