mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 21:20:29 +00:00
fix(settings): fix 404 on /settings for root user on cloud instance
- Make Server property nullable in Settings components (Index, Advanced, Updates) - Add conditional server loading: only load when not on cloud - Add null checks before using server for DNS validation and proxy configuration - Fix isInstanceAdmin() to check root team's pivot role directly instead of current team - Make root team (id=0) bypass subscription check on cloud - Remove isInstanceAdmin() from main middleware bypass: only settings/admin routes are exempted - Update isSubscribed() to only check isSubscriptionActive() for navbar consistency 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,13 +19,17 @@ class DecideWhatToDoWithUser
|
||||
if (auth()?->user()?->currentTeam()) {
|
||||
refreshSession(auth()->user()->currentTeam());
|
||||
}
|
||||
if (! auth()->user() || ! isCloud() || isInstanceAdmin()) {
|
||||
if (! auth()->user() || ! isCloud()) {
|
||||
if (! isCloud() && showBoarding() && ! in_array($request->path(), allowedPathsForBoardingAccounts())) {
|
||||
return redirect()->route('onboarding');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
// Instance admins can access settings and admin routes regardless of subscription
|
||||
if (isInstanceAdmin() && (Str::startsWith($request->path(), 'settings') || $request->path() === 'admin')) {
|
||||
return $next($request);
|
||||
}
|
||||
if (! auth()->user()->hasVerifiedEmail()) {
|
||||
if ($request->path() === 'verify' || in_array($request->path(), allowedPathsForInvalidAccounts()) || $request->routeIs('verify.verify')) {
|
||||
return $next($request);
|
||||
|
||||
Reference in New Issue
Block a user