Acegi , email-confirmation, .
:
reset, .
, reset,
, , . , EmailConfirmationService, .
def sendConfirmation(String emailAddress, String theSubject, Map model = null,
String userToken = null)
:
emailAddress = address of user changing password
theSubject = subject of e-mail sent
model = any data passed to GSP that creates e-mail body
userToken = hashed user password
( , ), onConfirmation.
Bootstrap.groovy :
def emailConfirmationService
def init = { servletContext ->
emailConfirmationService.onConfirmation = { email, hashedPassword ->
User user = User.findByEmail(email)
user.passwd = hashedPassword
if (!user.save()) {
}
[controller:'userProfile', action:'login']
}
}
, , reset .
source
share