kulls has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
I Just configured Catalyst from the manual. I'm getting the below error when I start the page . It seems like there is no user for the first load and trigger's this error. Can you suggest me how to fix this ?
Could not find authentication realm 'default' 89: } 90: 91: # If a user doesn't exist, force login 92: if (!$c->user_exists) { 93: # Dump a log message to the development server debu +g output 94: # $c->log->debug('***Root::auto User not found, for +warding to /login'); 95: # Redirect the user to the login page

Replies are listed 'Best First'.
Re: Catalyst : Could not find authentication realm 'default'
by lorn (Monk) on Jun 25, 2010 at 12:14 UTC

    Hi kulls

    Can you show to us a little bit more of code?

    Between, this is a normal mistake with Catalyst and DBIx:Class authenticate, take a look at manual <a href="http://search.cpan.org/~flora/Catalyst-Authentication-Store-DBIx-Class-0.1300/lib/Catalyst/Authentication/Store/DBIx/Class.pm>here

    I think that you make a mistake at conf:

    __PACKAGE__->config->{authentication} = { default_realm => 'members', realms => { members => { credential => { class => 'Password', password_field => 'password', password_type => 'clear' }, store => { class => 'DBIx::Class', user_model => 'MyApp::User', role_relation => 'roles', role_field => 'rolename', } } } };

    Lindolfo 'Lorn' Rodrigues
    -http://lornlab.org
    -@lornlab - twitter

    I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

      kulls says this error only occurs on the first page load, su supposedly it works afterwards, ie its not the common no-realm-specified pitfall

        Because of that, i asked for more pieces of code ;)

        Lindolfo 'Lorn' Rodrigues
        -http://lornlab.org
        -@lornlab - twitter

        I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

Re: Catalyst : Could not find authentication realm 'default'
by marsch (Initiate) on Jun 22, 2016 at 07:08 UTC

    Just stumbled over this. It is vital to load ConfigLoader plugin before Authentication plugin:

    use Catalyst qw/ ConfigLoader Authentication /;

    The configuration is not loaded if the order doesn't tell.

Re: Catalyst : Could not find authentication realm 'default'
by Anonymous Monk on Jun 25, 2010 at 11:19 UTC
    What?