mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: return admin role from session endpoint when auth is disabled
The GET /api/auth/session endpoint still returned role "user" and user-level permissions when AUTH_ENABLED=false, inconsistent with the middleware which now assigns role "admin". Fix the session endpoint to match so API clients get the correct role.
This commit is contained in:
@@ -297,9 +297,9 @@ export async function authRoutes(app: FastifyInstance): Promise<void> {
|
||||
user: {
|
||||
id: "anonymous",
|
||||
username: "anonymous",
|
||||
role: "user",
|
||||
role: "admin",
|
||||
mustChangePassword: false,
|
||||
permissions: getPermissions("user"),
|
||||
permissions: getPermissions("admin"),
|
||||
analyticsEnabled: null,
|
||||
analyticsConsentShownAt: null,
|
||||
analyticsConsentRemindAt: null,
|
||||
|
||||
Reference in New Issue
Block a user