Last active
August 29, 2015 14:27
-
-
Save adamtaylor/e76e8e93992183207b66 to your computer and use it in GitHub Desktop.
Catalyst authentication auto_update and auto_create result/resultset methods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MyApp::Schema::Result::User; | |
... | |
# Called everytime a user logs in | |
sub auto_update { | |
my ( $self, $auth_args ) = @_; | |
$self->update( $auth_args ); | |
return $self; | |
} | |
package MyApp::Schema::ResultSet::User; | |
... | |
# Called when a new user is found | |
sub auto_create { | |
my ( $self, $auth_args ) = @_; | |
my $user = $self->create( $auth_args ); | |
return $user; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment