mirror of
https://github.com/immich-app/immich.git
synced 2025-12-22 17:24:56 +03:00
@@ -89,7 +89,7 @@ export interface SystemConfig {
|
||||
buttonText: string;
|
||||
clientId: string;
|
||||
clientSecret: string;
|
||||
defaultStorageQuota: number;
|
||||
defaultStorageQuota: number | null;
|
||||
enabled: boolean;
|
||||
issuerUrl: string;
|
||||
mobileOverrideEnabled: boolean;
|
||||
@@ -253,7 +253,7 @@ export const defaults = Object.freeze<SystemConfig>({
|
||||
buttonText: 'Login with OAuth',
|
||||
clientId: '',
|
||||
clientSecret: '',
|
||||
defaultStorageQuota: 0,
|
||||
defaultStorageQuota: null,
|
||||
enabled: false,
|
||||
issuerUrl: '',
|
||||
mobileOverrideEnabled: false,
|
||||
|
||||
@@ -360,7 +360,9 @@ class SystemConfigOAuthDto {
|
||||
|
||||
@IsNumber()
|
||||
@Min(0)
|
||||
defaultStorageQuota!: number;
|
||||
@Optional({ nullable: true })
|
||||
@ApiProperty({ type: 'integer', format: 'int64' })
|
||||
defaultStorageQuota!: number | null;
|
||||
|
||||
@ValidateBoolean()
|
||||
enabled!: boolean;
|
||||
|
||||
@@ -704,7 +704,7 @@ describe(AuthService.name, () => {
|
||||
expect(mocks.user.create).toHaveBeenCalledWith(expect.objectContaining({ quotaSizeInBytes: 1_073_741_824 }));
|
||||
});
|
||||
|
||||
it('should not set quota for 0 quota', async () => {
|
||||
it('should set quota for 0 quota', async () => {
|
||||
const user = factory.userAdmin({ oauthId: 'oauth-id' });
|
||||
|
||||
mocks.systemMetadata.get.mockResolvedValue(systemConfigStub.oauthWithStorageQuota);
|
||||
@@ -726,7 +726,7 @@ describe(AuthService.name, () => {
|
||||
email: user.email,
|
||||
name: ' ',
|
||||
oauthId: user.oauthId,
|
||||
quotaSizeInBytes: null,
|
||||
quotaSizeInBytes: 0,
|
||||
storageLabel: null,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -300,7 +300,7 @@ export class AuthService extends BaseService {
|
||||
name: userName,
|
||||
email: profile.email,
|
||||
oauthId: profile.sub,
|
||||
quotaSizeInBytes: storageQuota * HumanReadableSize.GiB || null,
|
||||
quotaSizeInBytes: storageQuota === null ? null : storageQuota * HumanReadableSize.GiB,
|
||||
storageLabel: storageLabel || null,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ const updatedConfig = Object.freeze<SystemConfig>({
|
||||
buttonText: 'Login with OAuth',
|
||||
clientId: '',
|
||||
clientSecret: '',
|
||||
defaultStorageQuota: 0,
|
||||
defaultStorageQuota: null,
|
||||
enabled: false,
|
||||
issuerUrl: '',
|
||||
mobileOverrideEnabled: false,
|
||||
|
||||
Reference in New Issue
Block a user