mojolicious-lite

Mojolicious basic login with

房东的猫 提交于 2020-01-04 07:47:09
问题 iam looking for authentification in Mojolicious. I have 2 pages momcorp1 and momcorp2, But i cant pas between over pages, someone know how do this. Iam reaading about "under", but i dont undertah how do this. The other form do this is use -Mojolicious::Plugin::Authentication - but is more dificult. This is the code, when 1 click link to momcorp 2, show error. #!/usr/bin/env perl use Mojolicious::Lite; helper auth => sub { my $self = shift; return 1 if $self->param('username') eq 'user1' and

Mojolicious basic login with

筅森魡賤 提交于 2020-01-04 07:47:06
问题 iam looking for authentification in Mojolicious. I have 2 pages momcorp1 and momcorp2, But i cant pas between over pages, someone know how do this. Iam reaading about "under", but i dont undertah how do this. The other form do this is use -Mojolicious::Plugin::Authentication - but is more dificult. This is the code, when 1 click link to momcorp 2, show error. #!/usr/bin/env perl use Mojolicious::Lite; helper auth => sub { my $self = shift; return 1 if $self->param('username') eq 'user1' and

How to add and remove routes dynamically in Mojolicious?

喜夏-厌秋 提交于 2019-12-10 10:56:30
问题 I am trying to put together a maintenance page in my Mojolicious app which all of my users will be shown whenever a file or DB entry is present on the server. I know I can check for this file or entry on startup and if its there add in my 'catch all' route. However I'm not sure how to do this dynamically? I don't want to have to restart the backend whenever I want to go into maintenance. Is there a way to add and remove routes from a hook? for example use the before dispatch hook to monitor

Mojolicious: should I use one websocket or several?

你。 提交于 2019-12-09 21:29:18
问题 I'm teaching myself about Mojolicious and websockets. So far I've got a web page that displays rows from a database, and has buttons to add, delete, and update rows, and to select columns for sorting. At the moment, it uses 'one-shot' websockets in the javascript 'onclick' handlers for each button, and that works. Would it be more in-keeping with the intention of websockets, for the sockets to be kept alive and used for multiple clicks? I think the answer should be 'yes', because otherwise it