X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2F05_Authentication.pod;h=c94964747687b6de2adc469ca30a12c8a7d22b31;hb=0b60bbb5b9d7bd37b028ba4833a379b32e7b0eb7;hp=3831d6ad1e3964887c8e53fd97b3b7a7edfc4c58;hpb=861a0cddee96ce3d0531caeafb649a1d6cdec787;p=catagits%2FCatalyst-Manual.git diff --git a/lib/Catalyst/Manual/Tutorial/05_Authentication.pod b/lib/Catalyst/Manual/Tutorial/05_Authentication.pod index 3831d6a..c949647 100644 --- a/lib/Catalyst/Manual/Tutorial/05_Authentication.pod +++ b/lib/Catalyst/Manual/Tutorial/05_Authentication.pod @@ -166,7 +166,7 @@ C<1;>: # 2) Name of has_many() relationship this many_to_many() is shortcut for # 3) Name of belongs_to() relationship in model class of has_many() above # You must already have the has_many() defined to use a many_to_many(). - __PACKAGE__->many_to_many(roles => 'user_roles', 'role'); + __PACKAGE__->many_to_many(roles => 'user_roles', 'role_id'); The code for this update is obviously very similar to the edits we made to the C and C classes created in Chapter 3 with one @@ -374,7 +374,8 @@ and update the definition of C to match: } } else { # Set an error message - $c->stash(error_msg => "Empty username or password."); + $c->stash(error_msg => "Empty username or password.") + unless ($c->user_exists); } # If either of above don't work out, send to the login page @@ -552,7 +553,7 @@ use of an IF-THEN-ELSE construct in TT). =head2 Try Out Authentication The development server should have reloaded each time we edited one of -the Controllers in the previous section. Now trying going to +the Controllers in the previous section. Now try going to L and you should be redirected to the login page, hitting Shift+Reload or Ctrl+Reload if necessary (the "You are already logged in" message should I appear -- if it does, click @@ -698,7 +699,7 @@ C in your editor and enter the following text: $user->update; } -EncodedColumn lets us simple call C<$user->check_password($password)> +EncodedColumn lets us simply call C<$user->check_password($password)> to see if the user has supplied the correct password, or, as we show above, call C<$user->update($new_password)> to update the hashed password stored for this user. @@ -884,5 +885,6 @@ Please report any errors, issues or suggestions to the author. The most recent version of the Catalyst Tutorial can be found at L. -Copyright 2006-2010, Kennedy Clark, under Creative Commons License +Copyright 2006-2010, Kennedy Clark, under the +Creative Commons Attribution Share-Alike License Version 3.0 (L).