User injection

This commit is contained in:
thosakwe 2016-12-13 11:39:20 -05:00
parent feaab715da
commit a504ac46e6
3 changed files with 7 additions and 4 deletions

View file

@ -1,6 +1,6 @@
# angel_auth
![version 1.1.0-dev+13](https://img.shields.io/badge/version-1.1.0--dev+13-red.svg)
[![version 1.1.0-dev+14](https://img.shields.io/badge/version-1.1.0--dev+14-red.svg)](https://pub.dartlang.org/packages/angel_auth)
![build status](https://travis-ci.org/angel-dart/auth.svg?branch=master)
A complete authentication plugin for Angel. Inspired by Passport.

View file

@ -118,8 +118,11 @@ class AngelAuth extends AngelPlugin {
print('Now deserializing from this userId: ${token.userId}');
}
req.inject(AuthToken, req.properties['token'] = token);
req.properties["user"] = await deserializer(token.userId);
final user = await deserializer(token.userId);
req
..inject(AuthToken, req.properties['token'] = token)
..inject(user.runtimeType, req.properties["user"] = user);
}
return true;

View file

@ -1,6 +1,6 @@
name: angel_auth
description: A complete authentication plugin for Angel.
version: 1.0.0-dev+13
version: 1.0.0-dev+14
author: Tobe O <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/angel_auth
dependencies: