-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathRequestToken.pm
More file actions
38 lines (28 loc) · 948 Bytes
/
RequestToken.pm
File metadata and controls
38 lines (28 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package HTML::FormFu::Plugin::RequestToken;
use strict;
# VERSION
# AUTHORITY
# ABSTRACT: RequestToken plugin
use Moose;
use MooseX::Attribute::Chained;
extends 'HTML::FormFu::Plugin';
has context => ( is => 'rw', traits => ['Chained'] );
has field_name => ( is => 'rw', traits => ['Chained'] );
has session_key => ( is => 'rw', traits => ['Chained'] );
has expiration_time => ( is => 'rw', traits => ['Chained'] );
sub process {
my ($self) = @_;
return if $self->form->get_all_element( { name => $self->field_name } );
my $c = $self->form->stash->{'context'};
$self->form->elements(
[ { type => 'RequestToken',
name => $self->field_name,
expiration_time => $self->expiration_time,
context => $self->context,
session_key => $self->session_key
}
]
);
return;
}
1;