Skip to content

Commit

Permalink
Get Email source from profile if not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
jrouzierinverse committed Dec 17, 2024
1 parent 4e7cd67 commit cac6fa4
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ use Moose;
extends 'captiveportal::DynamicRouting::Module::Authentication';
with 'captiveportal::Role::FieldValidation';

has '+source' => (isa => 'pf::Authentication::Source::EmailSource');
has '+source' => (
isa => 'pf::Authentication::Source::EmailSource',
lazy => 1,
builder => '_build_source',
);

use pf::auth_log;
use pf::config qw(%Config);
Expand Down Expand Up @@ -171,6 +175,11 @@ sub auth_source_params_child {
};
}

sub _build_source {
my ($self) = @_;
return $self->app->profile->getSourceByType('Email');
}

=head1 AUTHOR
Inverse inc. <info@inverse.ca>
Expand Down

0 comments on commit cac6fa4

Please sign in to comment.