mirror of
https://github.com/immich-app/immich.git
synced 2026-03-08 11:07:25 +03:00
fix(server): don't publicly reveal user count (#4409)
* fix: don't reveal user count publicly * fix: mobile and user controller * fix: update other frontend endpoints * fix: revert openapi change * chore: open api * fix: initialize * openapi --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
committed by
GitHub
parent
09bf1c9175
commit
41befc0948
@@ -3,8 +3,8 @@ import { redirect } from '@sveltejs/kit';
|
||||
import type { PageServerLoad } from './$types';
|
||||
|
||||
export const load = (async ({ locals: { api } }) => {
|
||||
const { data } = await api.userApi.getUserCount({ admin: true });
|
||||
if (data.userCount === 0) {
|
||||
const { data } = await api.serverInfoApi.getServerConfig();
|
||||
if (!data.isInitialized) {
|
||||
// Admin not registered
|
||||
throw redirect(302, AppRoute.AUTH_REGISTER);
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ import { redirect } from '@sveltejs/kit';
|
||||
import type { PageServerLoad } from './$types';
|
||||
|
||||
export const load = (async ({ locals: { api } }) => {
|
||||
const { data } = await api.userApi.getUserCount({ admin: true });
|
||||
if (data.userCount != 0) {
|
||||
const { data } = await api.serverInfoApi.getServerConfig();
|
||||
if (data.isInitialized) {
|
||||
// Admin has been registered, redirect to login
|
||||
throw redirect(302, AppRoute.AUTH_LOGIN);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user