mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-28 07:58:31 +00:00
[ BasicAuth] remove auth on registration (#7915)
* Fix Version issue b/w api/v1/version and entity {id}/versions
* [UserResource] remove auth on user registration
* Fix Smtp settings
Co-authored-by: mohitdeuex <105265192+mohitdeuex@users.noreply.github.com>
This commit is contained in:
parent
4829dc1a4b
commit
895b2a35c3
@ -181,10 +181,9 @@ public class UserResource extends EntityResource<User, UserRepository> {
|
||||
ConfigurationHolder.getInstance()
|
||||
.getConfig(ConfigurationHolder.ConfigurationType.AUTHENTICATION_CONFIG, AuthenticationConfiguration.class)
|
||||
.getProvider();
|
||||
this.isEmailServiceEnabled =
|
||||
ConfigurationHolder.getInstance()
|
||||
.getConfig(ConfigurationType.SMTP_CONFIG, SmtpSettings.class)
|
||||
.getEnableSmtpServer();
|
||||
SmtpSettings smtpSettings =
|
||||
ConfigurationHolder.getInstance().getConfig(ConfigurationType.SMTP_CONFIG, SmtpSettings.class);
|
||||
this.isEmailServiceEnabled = smtpSettings != null && smtpSettings.getEnableSmtpServer();
|
||||
this.loginAttemptCache = new LoginAttemptCache();
|
||||
}
|
||||
|
||||
@ -1223,7 +1222,10 @@ public class UserResource extends EntityResource<User, UserRepository> {
|
||||
.contains(userName)) {
|
||||
newUser.setIsAdmin(true);
|
||||
}
|
||||
return dao.create(uriInfo, newUser);
|
||||
// remove auth mechanism from the user
|
||||
User registeredUser = dao.create(uriInfo, newUser);
|
||||
registeredUser.setAuthenticationMechanism(null);
|
||||
return registeredUser;
|
||||
}
|
||||
|
||||
public void confirmEmailRegistration(UriInfo uriInfo, String emailToken) throws IOException {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user