mirror of
https://github.com/immich-app/immich.git
synced 2025-12-18 09:13:15 +03:00
fix(server): Allow passwordless users when oauth enabled (#13517)
* fix(server): Allow passwordless users when oauth enabled * fix(web): Use features flags for checking oauth
This commit is contained in:
@@ -26,6 +26,10 @@ export class UserAdminService extends BaseService {
|
||||
|
||||
async create(dto: UserAdminCreateDto): Promise<UserAdminResponseDto> {
|
||||
const { notify, ...rest } = dto;
|
||||
const config = await this.getConfig({ withCache: false });
|
||||
if (!config.oauth.enabled && !rest.password) {
|
||||
throw new BadRequestException('password is required');
|
||||
}
|
||||
const user = await createUser({ userRepo: this.userRepository, cryptoRepo: this.cryptoRepository }, rest);
|
||||
|
||||
await this.eventRepository.emit('user.signup', {
|
||||
|
||||
Reference in New Issue
Block a user