diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-09-12 08:15:59 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-09-12 08:15:59 +0200 |
commit | 79b55c430d85e39da029c5c2006bf89c0683b13b (patch) | |
tree | 70f7927e1bda4d4b31e40270546485557f69c687 /lib | |
parent | 9d4f3f8ce124023f704d5ca1a9e7a87029b43073 (diff) |
allow registration to be disabled via config
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/Travelynx.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index 8ef5fbf..91de1c6 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -2519,7 +2519,6 @@ sub startup { $r->get('/login')->to('account#login_form'); $r->get('/recover')->to('account#request_password_reset'); $r->get('/recover/:id/:token')->to('account#recover_password'); - $r->get('/register')->to('account#registration_form'); $r->get('/reg/:id/:token')->to('account#verify'); $r->get('/status/:name')->to('traveling#user_status'); $r->get('/status/:name/:ts')->to('traveling#user_status'); @@ -2533,9 +2532,13 @@ sub startup { $r->post('/geolocation')->to('traveling#geolocation'); $r->post('/list_departures')->to('traveling#redirect_to_station'); $r->post('/login')->to('account#do_login'); - $r->post('/register')->to('account#register'); $r->post('/recover')->to('account#request_password_reset'); + if ( not $self->config->{registration}{disabled} ) { + $r->get('/register')->to('account#registration_form'); + $r->post('/register')->to('account#register'); + } + my $authed_r = $r->under( sub { my ($self) = @_; |