salt source Object instance

0

I need to maintain a login part of users of a grails application, but I do not know anything about this language.

A piece of code looks like this:

@Transactional
class RegisterService {

   def saltSource
   def springSecurityUiService
   def grailsApplication
   def changePassword(RegistrationCode registrationCode, String password) {

      String salt = saltSource instanceof NullSaltSource ? null : registrationCode.username

      RegistrationCode.withTransaction { status ->
         String usernameFieldName = SpringSecurityUtils.securityConfig.userLookup.usernamePropertyName
         def user = User.findWhere((usernameFieldName): registrationCode.username)
         user.password = springSecurityUiService.encodePassword(password, salt)
         user.save()
         registrationCode.delete()
      }
   }
}

At no time does the saltSource object fill up so I would like to know if the line to fill in the string "salt" would not always be filled with registrationCode.username?

    
asked by anonymous 25.09.2018 / 22:25

0 answers