Verified Commit 7d036f01 authored by Luc Didry's avatar Luc Didry

Allow to use a load method from ->config('load_user_method')

parent 18f80f01
Pipeline #158340 passed with stage
in 1 minute and 44 seconds
......@@ -2,7 +2,7 @@
package Mojolicious::Plugin::FiatTux::GrantAccess;
use Mojo::Base 'Mojolicious::Plugin';
our $VERSION = '0.06';
our $VERSION = '0.07';
sub register {
my ($self, $app) = @_;
......@@ -24,6 +24,11 @@ sub register {
session_key => ucfirst($app->moniker),
load_user => sub {
my ($c, $user) = @_;
if (defined $app->config('load_user_method')) {
$user = $app->config('load_user_method')->($user, $app);
}
return $user;
},
validate_user => sub {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment