| 1 | package Daje::Plugin::Login; | ||
| 2 | 1 | ▶ | use Mojo::Base 'Mojolicious::Plugin', -signatures; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use v5.40; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | # NAME | ||
| 6 | # ==== | ||
| 7 | # | ||
| 8 | # Daje::Plugin::Login - It's new $module | ||
| 9 | # | ||
| 10 | # SYNOPSIS | ||
| 11 | # ======== | ||
| 12 | # | ||
| 13 | # use Daje::Plugin::Login; | ||
| 14 | # | ||
| 15 | # DESCRIPTION | ||
| 16 | # =========== | ||
| 17 | # | ||
| 18 | # Daje::Plugin::Login is ... | ||
| 19 | # | ||
| 20 | # LICENSE | ||
| 21 | # ======= | ||
| 22 | # | ||
| 23 | # Copyright (C) janeskil1525. | ||
| 24 | # | ||
| 25 | # This library is free software; you can redistribute it and/or modify | ||
| 26 | # it under the same terms as Perl itself. | ||
| 27 | # | ||
| 28 | # AUTHOR | ||
| 29 | # ====== | ||
| 30 | # | ||
| 31 | # janeskil1525 E<lt>janeskil1525@gmail.comE<gt> | ||
| 32 | # | ||
| 33 | |||
| 34 | 0 | ▶ | use Daje::Helper::Login; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 35 | |||
| 36 | our $VERSION = "0.02"; | ||
| 37 | |||
| 38 | |||
| 39 | |||
| 40 | sub register ($self, $app, $config) { | ||
| 41 | |||
| 42 | my $r = $app->routes(); | ||
| 43 | $r->put('/api/login/')->to('Login#login_user'); | ||
| 44 | |||
| 45 | $app->helper(login => sub {state $login = Daje::Helper::Login->new(pg => $app->pg)}); | ||
| 46 | |||
| 47 | $app->log->debug("Daje::Plugin::Login registered"); | ||
| 48 | } | ||
| 49 | |||
| 50 | 1; | ||
| 51 | __END__ | ||