Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Mobile App
Manage
Activity
Members
Labels
Plan
Issues
3
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Code
Mobile App
Commits
4882815c
Commit
4882815c
authored
5 years ago
by
Markin Igor
Browse files
Options
Downloads
Patches
Plain Diff
Rework serving OAuth params.
parent
f844037c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Mobile app initial implementation.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/config.dart
+11
-10
11 additions, 10 deletions
lib/config.dart
lib/src/screens/home.dart
+7
-6
7 additions, 6 deletions
lib/src/screens/home.dart
with
18 additions
and
16 deletions
lib/config.dart
+
11
−
10
View file @
4882815c
...
...
@@ -5,14 +5,15 @@ enum Flavor {
class
Config
{
static
Flavor
appFlavor
;
}
const
String
APP_HOST
=
"https://demo1.vereign.com"
;
static
const
DEFAULT_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
static
Map
<
String
,
String
>
getOAuthParams
({
host
=
DEFAULT_APP_HOST
})
{
return
{
"clientId"
:
"123123"
,
"clientSecret"
:
"123123"
,
"redirectUrl"
:
"app://com.vereign.app/oauth2"
,
"authEndpoint"
:
"
$host
/api/oauth2/authorize"
,
"tokenEndpoint"
:
"
$host
/api/oauth2/token"
,
};
}
}
This diff is collapsed.
Click to expand it.
lib/src/screens/home.dart
+
7
−
6
View file @
4882815c
...
...
@@ -20,7 +20,6 @@ class Home extends StatefulWidget {
const
hosts
=
[
'https://rosengeorgiev.dev.vereign.com'
,
'https://borisdimitrov.dev.vereign.com'
,
'https://app.vereign.com'
,
'https://integration.vereign.com'
,
'https://staging.vereign.com'
,
'https://demo1.vereign.com'
,
...
...
@@ -39,7 +38,7 @@ const hosts = [
];
class
_HomeState
extends
State
<
Home
>
{
String
_host
=
Config
.
appFlavor
==
Flavor
.
DEVELOPMENT
?
hosts
[
0
]
:
APP_HOST
;
String
_host
=
Config
.
appFlavor
==
Flavor
.
DEVELOPMENT
?
hosts
[
0
]
:
Config
.
DEFAULT_
APP_HOST
;
@override
initState
()
{
...
...
@@ -104,15 +103,17 @@ class _HomeState extends State<Home> {
}
startOAuth
()
{
var
params
=
Config
.
getOAuthParams
(
host:
_host
);
FlutterAppAuthWrapper
.
startAuth
(
AuthConfig
(
clientId:
CLIENT_ID
,
clientSecret:
CLIENT_SECRET
,
redirectUrl:
REDIRECT_URL
,
clientId:
params
[
"clientId"
]
,
clientSecret:
params
[
"clientSecret"
]
,
redirectUrl:
params
[
"redirectUrl"
]
,
state:
"login"
,
prompt:
"consent"
,
endpoint:
AuthEndpoint
(
auth:
AUTH_ENDPOINT
,
token:
TOKEN_ENDPOINT
),
auth:
params
[
"authEndpoint"
],
token:
params
[
"tokenEndpoint"
]
),
scopes:
[
"user_account_status"
,
"user_territory"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment