server: Better account handling

The account related routes were moved to /account. For performance
reasons, we use a weaker password hash algorithm. The possibility to
modify or delete an account was added.
This commit is contained in:
Elias Projahn 2020-05-13 13:42:07 +02:00
parent 3d3d5d50a6
commit 0847dde610
4 changed files with 144 additions and 45 deletions

View file

@ -41,8 +41,12 @@ class MusicusServer extends ApplicationChannel {
@override
Controller get entryPoint => Router()
..route('/login').link(() => LoginController(serverDb, secret))
..route('/register').link(() => RegisterController(serverDb))
..route('/account/register').link(() => RegisterController(serverDb))
..route('/account/details')
.link(() => AuthorizationController(serverDb, secret))
.link(() => AccountDetailsController(serverDb))
..route('/account/delete').link(() => AccountDeleteController(serverDb))
..route('/account/login').link(() => LoginController(serverDb, secret))
..route('/persons/[:id]')
.link(() => AuthorizationController(serverDb, secret))
.link(() => PersonsController(db))