platform/lib/src/options.dart

24 lines
619 B
Dart
Raw Normal View History

2016-12-07 23:09:21 +00:00
import 'package:angel_framework/angel_framework.dart';
2017-01-20 23:15:21 +00:00
import 'auth_token.dart';
2016-12-07 23:09:21 +00:00
typedef AngelAuthCallback(
2016-12-21 18:28:51 +00:00
RequestContext req, ResponseContext res, String token);
2016-12-07 23:09:21 +00:00
2017-01-20 23:15:21 +00:00
typedef AngelAuthTokenCallback(
RequestContext req, ResponseContext res, AuthToken token, user);
2016-09-21 06:19:52 +00:00
class AngelAuthOptions {
2016-12-07 23:09:21 +00:00
AngelAuthCallback callback;
2017-01-20 23:15:21 +00:00
AngelAuthTokenCallback tokenCallback;
2016-11-28 01:04:52 +00:00
bool canRespondWithJson;
2016-09-21 06:19:52 +00:00
String successRedirect;
String failureRedirect;
2016-11-28 01:04:52 +00:00
AngelAuthOptions(
2016-12-07 23:09:21 +00:00
{this.callback,
2017-01-20 23:15:21 +00:00
this.tokenCallback,
2016-12-07 23:09:21 +00:00
this.canRespondWithJson: true,
2016-11-28 01:04:52 +00:00
this.successRedirect,
String this.failureRedirect});
}