Bump to 2.0.2

This commit is contained in:
Tobe O 2018-11-09 13:01:37 -05:00
parent 7d86f77ed2
commit e490afe637
3 changed files with 9 additions and 3 deletions

View file

@ -1,3 +1,6 @@
# 2.0.2
* Handle `null` return in `authenticate` + `failureRedirect`.
# 2.0.1
* Add generic parameter to `options` on `AuthStrategy.authenticate`.

View file

@ -277,7 +277,7 @@ class AngelAuth<User> {
: await strategy.authenticate(req, res, options);
if (result == true)
return result;
else if (result != false) {
else if (result != false && result != null) {
var userId = await serializer(result);
// Create JWT
@ -325,7 +325,10 @@ class AngelAuth<User> {
res.statusCode == 302 ||
res.headers.containsKey('location'))
return false;
else
else if (options?.failureRedirect != null) {
res.redirect(options.failureRedirect);
return false;
} else
throw new AngelHttpException.notAuthenticated();
}
}

View file

@ -1,6 +1,6 @@
name: angel_auth
description: A complete authentication plugin for Angel. Includes support for stateless JWT tokens, Basic Auth, and more.
version: 2.0.1
version: 2.0.2
author: Tobe O <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/angel_auth
environment: