diff --git a/lib/config.dart b/lib/config.dart index ccf766c887d92f8d4ba916bbc37ab14caa0e0212..b155306aa5a4cdd5bb99b9e4f5c25d65c2b66593 100644 --- a/lib/config.dart +++ b/lib/config.dart @@ -1 +1,9 @@ -const String APP_HOST = "https://demo1.vereign.com"; \ No newline at end of file +const String APP_HOST = "https://demo1.vereign.com"; + +/* OAuth */ +const String CLIENT_ID = "123123"; +const String CLIENT_SECRET = "123123"; + +const String REDIRECT_URL = "app://com.vereign.app/oauth2"; +const String AUTH_ENDPOINT = "$APP_HOST/api/oauth2/authorize"; +const String TOKEN_ENDPOINT = "$APP_HOST/api/oauth2/token"; \ No newline at end of file diff --git a/lib/screens/home.dart b/lib/screens/home.dart index 1ad3333874a3684ff7b82584d1c4a2da85ea2959..84f69d1824f7d6c968c23b05c84e6ae766f0af97 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -17,13 +17,6 @@ class Home extends StatefulWidget { _HomeState createState() => _HomeState(); } -String clientId = "222222"; -String clientSecret = "22222222"; - -String redirectURL = "app://com.vereign.app/oauth2"; -String authEndpoint = "$APP_HOST/api/oauth2/authorize"; -String tokenEndpoint = "$APP_HOST/api/oauth2/token"; - class _HomeState extends State<Home> { @override initState() { @@ -90,13 +83,13 @@ class _HomeState extends State<Home> { startOAuth() { FlutterAppAuthWrapper.startAuth( AuthConfig( - clientId: clientId, - clientSecret: clientSecret, - redirectUrl: redirectURL, + clientId: CLIENT_ID, + clientSecret: CLIENT_SECRET, + redirectUrl: REDIRECT_URL, state: "login", prompt: "consent", endpoint: AuthEndpoint( - auth: authEndpoint, token: tokenEndpoint), + auth: AUTH_ENDPOINT, token: TOKEN_ENDPOINT), scopes: [ "user_account_status", "user_territory",