Update auth.dart
This commit is contained in:
parent
52fedf6d17
commit
9794d05264
1 changed files with 2 additions and 2 deletions
|
@ -11,7 +11,7 @@ class AuthController extends Controller {
|
||||||
serializer(User user) async => user.id;
|
serializer(User user) async => user.id;
|
||||||
|
|
||||||
/// Attempt to log a user in
|
/// Attempt to log a user in
|
||||||
verifier(UserService userService) {
|
LocalAuthVerifier localVerifier(UserService userService) {
|
||||||
return (String username, String password) async {
|
return (String username, String password) async {
|
||||||
List<User> users = await userService.index({'query':{'username': username}});
|
List<User> users = await userService.index({'query':{'username': username}});
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class AuthController extends Controller {
|
||||||
..serializer = serializer
|
..serializer = serializer
|
||||||
..deserializer = deserializer
|
..deserializer = deserializer
|
||||||
..strategies.add(
|
..strategies.add(
|
||||||
new LocalAuthStrategy(verifier(app.container.make(UserService))));
|
new LocalAuthStrategy(localVerifier(app.container.make(UserService))));
|
||||||
|
|
||||||
await super.call(app);
|
await super.call(app);
|
||||||
await app.configure(auth);
|
await app.configure(auth);
|
||||||
|
|
Loading…
Reference in a new issue