Hi,
I am using ColdBox and trying to leverage some of the ORM features. I have a handler which ultimately runs a SQL query for authentication and then sets some session variables in a struct. Providing the user is authenticated I redirect them to my handler (account.dashboard).
For some reason after redirection the key in my structure “objUser” isn’t accessible. Before the redirect it is and I can dump it out using writedump(), after the setNextEvent() call I dump it out and get the error: “could not initialize proxy - no Session”.
Any idea what’s going on?
// check if we have a user in our database with the email passed in from the login form
var objUser = ORMService.findIt( “from User as u where u.email=:email”,{ email=rc.email} );
// if we find a record, password may still be wrong though
if( !isNull( objUser ) ) {
inputHash = Hash(rc.pwd & objUser.getSalt(), ‘SHA-512’);
prc.validAccount = NOT Compare(inputHash, objUser.getPwd());
if(prc.validAccount) {
// based on the account type log the user in
switch(objUser.getAccountTypeId()) {
// business account
case 1:
session.user.isLoggedIn = true;
session.user.objUser = objUser;
setNextEvent(“account.dashboard”);
break;
}
}