Implement bcrypt command

This commit is contained in:
swag 2022-10-18 21:28:18 -04:00
parent d82b5978b3
commit 6da98c996c
3 changed files with 20 additions and 2 deletions

View File

@ -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

View File

@ -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);

View 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