Updated auth_oauth2

This commit is contained in:
thomashii 2021-07-10 09:45:50 +08:00
parent f70f090e7b
commit 340d8a926d
4 changed files with 12 additions and 7 deletions

View file

@ -1,5 +1,9 @@
# Change Log # Change Log
## 4.0.2
* Updated example
## 4.0.1 ## 4.0.1
* Updated README * Updated README

View file

@ -1,6 +1,6 @@
# Angel3 OAuth2 Handler # 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) [![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) [![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)

View file

@ -47,11 +47,12 @@ void main() async {
var mappedUserService = userService.map(User.parse, User.serialize); var mappedUserService = userService.map(User.parse, User.serialize);
// Set up the authenticator plugin. // Set up the authenticator plugin.
var auth = var auth = AngelAuth<User>(
AngelAuth<User>(jwtKey: 'oauth2 example secret', allowCookie: false); serializer: (user) async => user.id,
auth.serializer = (user) async => user.id; deserializer: (id) => mappedUserService.read(id.toString()),
auth.deserializer = (id) => mappedUserService.read(id.toString()); jwtKey: 'oauth2 example secret',
app.fallback(auth.decodeJwt); allowCookie: false);
await app.configure(auth.configureServer);
/// Create an instance of the strategy class. /// Create an instance of the strategy class.
auth.strategies['github'] = OAuth2Strategy( auth.strategies['github'] = OAuth2Strategy(

View file

@ -1,5 +1,5 @@
name: angel3_auth_oauth2 name: angel3_auth_oauth2
version: 4.0.1 version: 4.0.2
description: Angel3 library for authenticating users with external identity providers via OAuth2. description: Angel3 library for authenticating users with external identity providers via OAuth2.
homepage: https://angel3-framework.web.app/ homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/angel3/packages/auth_oauth2 repository: https://github.com/dukefirehawk/angel/tree/angel3/packages/auth_oauth2