Updated auth_oauth2
This commit is contained in:
parent
f70f090e7b
commit
340d8a926d
4 changed files with 12 additions and 7 deletions
|
@ -1,5 +1,9 @@
|
|||
# Change Log
|
||||
|
||||
## 4.0.2
|
||||
|
||||
* Updated example
|
||||
|
||||
## 4.0.1
|
||||
|
||||
* Updated README
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Angel3 OAuth2 Handler
|
||||
|
||||
[![version](https://img.shields.io/badge/pub-v4.0.1-brightgreen)](https://pub.dartlang.org/packages/angel3_auth_oauth2)
|
||||
[![version](https://img.shields.io/badge/pub-v4.0.2-brightgreen)](https://pub.dartlang.org/packages/angel3_auth_oauth2)
|
||||
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)
|
||||
[![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)
|
||||
|
||||
|
|
|
@ -47,11 +47,12 @@ void main() async {
|
|||
var mappedUserService = userService.map(User.parse, User.serialize);
|
||||
|
||||
// Set up the authenticator plugin.
|
||||
var auth =
|
||||
AngelAuth<User>(jwtKey: 'oauth2 example secret', allowCookie: false);
|
||||
auth.serializer = (user) async => user.id;
|
||||
auth.deserializer = (id) => mappedUserService.read(id.toString());
|
||||
app.fallback(auth.decodeJwt);
|
||||
var auth = AngelAuth<User>(
|
||||
serializer: (user) async => user.id,
|
||||
deserializer: (id) => mappedUserService.read(id.toString()),
|
||||
jwtKey: 'oauth2 example secret',
|
||||
allowCookie: false);
|
||||
await app.configure(auth.configureServer);
|
||||
|
||||
/// Create an instance of the strategy class.
|
||||
auth.strategies['github'] = OAuth2Strategy(
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: angel3_auth_oauth2
|
||||
version: 4.0.1
|
||||
version: 4.0.2
|
||||
description: Angel3 library for authenticating users with external identity providers via OAuth2.
|
||||
homepage: https://angel3-framework.web.app/
|
||||
repository: https://github.com/dukefirehawk/angel/tree/angel3/packages/auth_oauth2
|
||||
|
|
Loading…
Reference in a new issue