Last active
July 15, 2020 12:36
-
-
Save magicleon94/3eaefac18b3b95cad19d66d6dadd263d to your computer and use it in GitHub Desktop.
Abstract class for auth0 login - for medium article
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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