grails의 그 인코딩을 자꾸 잊어버려요. 여기 적어두세요...

719 단어
grails의 s2-quickstart에서 생성된user domain에서 진행됐습니다.
def beforeInsert() {
		encodePassword()
	}

	def beforeUpdate() {
		if (isDirty('password')) {
			encodePassword()
		}
	}

	protected void encodePassword() {
		password = springSecurityService.encodePassword(password)
	}
레지스터 때 엔코드가 패스워드를 한 번 더 해서 de코드가 꺼졌다.
플러그인 코드를 바꾸는 것 외에 새 버전의 많은 등록 코드에 판단을 추가하여 설정에 따라 encode 여부를 결정합니다
String encodePassword(String password, salt) {
		def encode = SpringSecurityUtils.securityConfig.ui.encodePassword
		if (!(encode instanceof Boolean) || (encode instanceof Boolean && encode)) {
			password = springSecurityService.encodePassword(password, salt)
		}
		password
	}

좋은 웹페이지 즐겨찾기