Implement bcrypt command
This commit is contained in:
parent
d82b5978b3
commit
6da98c996c
|
@ -32,8 +32,6 @@ Run the tests locally (against development environment):
|
||||||
|
|
||||||
## TODOs
|
## TODOs
|
||||||
|
|
||||||
1. Implement
|
|
||||||
[bcrypt](https://metacpan.org/pod/Mojolicious::Plugin::BcryptSecure)
|
|
||||||
1. Some sort of admin/moderator login and view
|
1. Some sort of admin/moderator login and view
|
||||||
1. CSS
|
1. CSS
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,8 @@ sub startup($self) {
|
||||||
|
|
||||||
$self->asset->process('main.css', 'css/PostText.css');
|
$self->asset->process('main.css', 'css/PostText.css');
|
||||||
|
|
||||||
|
push @{$self->commands->namespaces}, 'PostText::Command';
|
||||||
|
|
||||||
# Begin routing
|
# Begin routing
|
||||||
my $r = $self->routes->under(sub ($c) {
|
my $r = $self->routes->under(sub ($c) {
|
||||||
$c->session(expires => time + 31536000);
|
$c->session(expires => time + 31536000);
|
||||||
|
|
18
lib/PostText/Command/bcrypt.pm
Normal file
18
lib/PostText/Command/bcrypt.pm
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
package PostText::Command::bcrypt;
|
||||||
|
|
||||||
|
use Mojo::Base 'Mojolicious::Command', -signatures;
|
||||||
|
|
||||||
|
has description => 'Hash a string with brcypt';
|
||||||
|
has usage => sub ($self) { $self->extract_usage };
|
||||||
|
|
||||||
|
sub run($self, @args) {
|
||||||
|
say $self->app->bcrypt($_) for @args;
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
Usage: APPLICATION bcrypt STRING(S)
|
||||||
|
|
||||||
|
=cut
|
Loading…
Reference in New Issue
Block a user