Skip to content

Instantly share code, notes, and snippets.

@magicleon94
Last active July 15, 2020 12:36
Show Gist options
  • Save magicleon94/3eaefac18b3b95cad19d66d6dadd263d to your computer and use it in GitHub Desktop.
Save magicleon94/3eaefac18b3b95cad19d66d6dadd263d to your computer and use it in GitHub Desktop.
Abstract class for auth0 login - for medium article
abstract class AuthManager {
static AuthManager _instance;
static AuthManager get instance {
if (_instance == null) {
if (kIsWeb) {
_instance = Auth0ManagerForWeb();
} else {
_instance = Auth0Manager();
}
}
return _instance;
}
Future<User> login([Map<String, String> authResponse]);
Future<User> userFromTokens(String idToken, String accessToken);
Future<void> logout();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment