-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(server): Allow passwordless users when oauth enabled #13517
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! You can use the $featureFlag.oauthEnabled store instead I think
@jrasm91 Thanks for the suggestion. I have updated it to use featureFlags. |
@@ -62,7 +62,6 @@ export class UserAdminCreateDto { | |||
@Transform(toEmail) | |||
email!: string; | |||
|
|||
@IsNotEmpty() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this just allows empty strings, but it should probably have Optional({ nullable: true }) and still keep the is not empty. We should also test that you cannot login with an empty string of password login is enabled still
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have set password to be string in the user entity. So would it be okay to insert null values?
immich/server/src/entities/user.entity.ts
Line 33 in 3f66310
password?: string; |
And during login we have added check for not allowing empty password
immich/server/src/services/auth.service.ts
Line 329 in 3f66310
if (!user || !user.password) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah null
values would be preferred over empty strings IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see that we don't allow null in the database. We can change that later I think. We'll allow empty now, and move to null
in the future.
…13517) * fix(server): Allow passwordless users when oauth enabled * fix(web): Use features flags for checking oauth
This PR fixes : #13274
It allows creation of passwordless users when Oauth is enabled in config.