Improved user management routes
Change-Id: I3310e03a96565f6c02fe48710c1ef4e48e6fe115
diff --git a/lib/Kalamar.pm b/lib/Kalamar.pm
index 9623a81..12b5ded 100644
--- a/lib/Kalamar.pm
+++ b/lib/Kalamar.pm
@@ -87,7 +87,8 @@
'Search', # Abstract Search framework
'CHI', # Global caching mechanism
'TagHelpers::MailToChiffre', # Obfuscate email addresses
- 'KalamarHelpers' # Specific Helpers for Kalamar
+ 'KalamarHelpers', # Specific Helpers for Kalamar
+ 'KalamarUser' # Specific Helpers for Kalamar
) {
$self->plugin($_);
};
@@ -109,6 +110,7 @@
$r->get('/')->to('search#query')->name('index');
# Collection route
+ # TODO: Probably rename to /corpus
$r->get('/collection')->to('Search#collections')->name('collections');
$r->get('/collection/:id')->to('Search#collection')->name('collection');
@@ -128,8 +130,12 @@
my $match = $text->get('/:match_id');
$match->to('search#match_info')->name('match');
- $r->post('/login')->to('User#login');
- $r->post('/logout')->to('User#logout');
+ # User Management
+ $r->any('/user')->to(controller => 'User');
+ $r->post('/login')->to(action => 'login')->name('login');
+ $r->get('/logout')->to(action => 'logout')->name('logout');
+ $r->any('/register')->to(action => 'register')->name('register');
+ $r->any('/forgotten')->to(action => 'pwdforgotten')->name('pwdforgotten');
# Default user is called 'korap'
# $r->route('/user/:user/:collection')