mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00: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:
parent
3f663106e8
commit
bb694aeeeb
4 changed files with 14 additions and 4 deletions
|
|
@ -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', {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue