| 1 | package Mojolicious::Plugin::Passphrase; | ||
| 2 | 2 | $Mojolicious::Plugin::Passphrase::VERSION = '0.003'; | |
| 3 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 2 | ▶ | use Mojo::Base 'Mojolicious::Plugin'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 2 | ▶ | use Crypt::Passphrase; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 1 | ▶ | sub register { |
|
Subroutine
register: called CC=1 SCAR=0.0
Pod
documented
| |||
| 11 | 1 | my (undef, $app, $config) = @_; | |
| 12 | |||
| 13 | 1 | my $passphrase = Crypt::Passphrase->new(%{$config}); | |
| 14 | |||
| 15 | 5 | ▶ | $app->helper(hash_password => sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 16 | 5 | my ($c, @args) = @_; | |
| 17 | 5 | return $passphrase->hash_password(@args); | |
| 18 | 1 | }); | |
| 19 | |||
| 20 | 6 | ▶ | $app->helper(verify_password => sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 21 | 6 | my ($c, @args) = @_; | |
| 22 | 6 | return $passphrase->verify_password(@args); | |
| 23 | 1 | }); | |
| 24 | |||
| 25 | 0 | ▶ | $app->helper(password_needs_rehash => sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 26 | 0 | my ($c, @args) = @_; | |
| 27 | 0 | return $passphrase->needs_rehash(@args); | |
| 28 | 1 | }); | |
| 29 | |||
| 30 | 1 | return; | |
| 31 | } | ||
| 32 | |||
| 33 | 2 | 1; | |
| 34 | |||
| 35 | |||
| 36 | #ABSTRACT: Securely hash and validate your passwords. | ||
| 37 | |||
| 38 | __END__ | ||