I have my authentication working through the company LDAP server. I am
attempting to check for the existence of the user in a sqlite table and
add them and their role if they are not found. I do this during the login:
if ($username $password) {
# Attempt to log the user in
if
I'm not an expert but your check for existing user in the database should
be -find;
-search will return a resultset unless there is an exception.
Also, you may want this instead.
my $user = $c-model('authdb::User')-create({ username = $username });
$user-create_related('user_roles', {role='1'});
/2012 03:28 PM
Subject:
Re: [Catalyst] Need help inserting
I'm not an expert but your check for existing user in the database should
be -find;
-search will return a resultset unless there is an exception.
Also, you may want this instead.
my $user = $c-model('authdb::User')-create({ username