From d21fa4f54534ac03317cccdf7822547e163a1cae Mon Sep 17 00:00:00 2001 From: thosakwe Date: Sat, 10 Jun 2017 14:19:59 -0400 Subject: [PATCH] Controller docs --- lib/src/routes/controllers/auth.dart | 11 ++++++++++- lib/src/routes/controllers/controllers.dart | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/src/routes/controllers/auth.dart b/lib/src/routes/controllers/auth.dart index 1139429..1ca5a97 100644 --- a/lib/src/routes/controllers/auth.dart +++ b/lib/src/routes/controllers/auth.dart @@ -3,8 +3,17 @@ library angel.routes.controllers.auth; import 'package:angel_common/angel_common.dart'; import '../../services/user.dart'; +/// Configures the application to authenticate users securely. +/// See the documentation for controllers: +/// +/// https://github.com/angel-dart/angel/wiki/Controllers @Expose('/auth') class AuthController extends Controller { + /// Controls application authentication. + /// + /// See the documentation: + /// * https://medium.com/the-angel-framework/logging-users-in-to-angel-applications-ccf32aba0dac + /// * https://github.com/angel-dart/auth AngelAuth auth; /// Clients will see the result of `deserializer`, so let's pretend to be a client. @@ -15,7 +24,7 @@ class AuthController extends Controller { serializer(User user) async => user.id; - /// Attempt to log a user in + /// Attempts to log a user in. LocalAuthVerifier localVerifier(Service userService) { return (String username, String password) async { Iterable users = await userService.index({ diff --git a/lib/src/routes/controllers/controllers.dart b/lib/src/routes/controllers/controllers.dart index bf03d6b..db68c44 100644 --- a/lib/src/routes/controllers/controllers.dart +++ b/lib/src/routes/controllers/controllers.dart @@ -4,5 +4,6 @@ import 'package:angel_common/angel_common.dart'; import 'auth.dart'; configureServer(Angel app) async { + /// Controllers will not function unless wired to the application! await app.configure(new AuthController()); }