I'm doing the following now, have you tried it?

Inside the runmode I want the login to happen:

sub another_runmode {
    ...
    $self->query->param( -name => 'auth_usr_uname',  value => $uname);
    $self->query->param( -name => 'auth_usr_passwd', value => $passwd);
    $self->authen->initialize;
    ...
}

the idea is, set the query params that Authen is looking for and then
call authen->initialize in the runmode.

Giannis



Simon Rees wrote:
> Hi
>
> I'm using CGI::Application::Plugin::Authentication in my web application and 
> have found it useful but I'm stuck on a good way to implement some 
> functionality I need.
>
> After a user has submitted their registration details I need to Authenticate 
> them straight away. The registration form contains a number of fields 
> including their chosen username and password which is submitted to a 
> CGI::App runmode where the data is validated and inserted into the 
> database.
> The problem is that CGI::Application::Plugin::Authentication::initialize has 
> already been executed by the time this occurs.
>
> Any ideas on how I could do this? I'm currently redirecting after processing 
> the registration data with the credentials in the query string - but I'm 
> not terribly comfortable with this solution...
>
> One idea I had for an enhancement to the plugin was to add a reinitialize 
> method which didn't check $self->{initialized} before checking the 
> credentials. If the credentials were valid the user would be logged in from 
> this point. I haven't checked through the code in detail to understand the 
> implications of this yet... does it sound like a good idea?
>
> cheers, Simon
>
>   

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to