Ignore:
Timestamp:
Apr 6, 2011, 11:36:21 AM (9 years ago)
Author:
robert@…
Message:

Solved user registration bugs: changing password didn't work and lost password form resulted in an error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/authentication/RegisterController.groovy

    r1430 r1712  
    5656                }
    5757
    58                 def registrationCode = new RegistrationCode(username: user.username).save()
    59 
     58                def registrationCode = new RegistrationCode(username: user.username, expiryDate: new Date() + 1 )
     59                if( !registrationCode.save() ) {
     60                        println registrationCode.errors
     61                        flash.userError = "Your password could not be reset because of database errors. Please contact the system administrator."
     62                        return
     63                }
     64               
    6065                String url = generateLink('resetPassword', [t: registrationCode.token])
    6166
Note: See TracChangeset for help on using the changeset viewer.