Skip to content

Commit 68560ca

Browse files
authored
Feature/expose scopes (#233)
* Expose scopes in iOS * Expose scopes in Android * Add scopes to the example app * Add scopes to the readme * Add scopes type definition to typescript
1 parent 6cf59be commit 68560ca

File tree

19 files changed

+123
-22
lines changed

19 files changed

+123
-22
lines changed

Example/AndroidExample/.eslintrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
extends:
3+
- formidable/configurations/es6-react
4+
plugins:
5+
- jest
6+
env:
7+
jest/globals: true
8+
browser: true
9+
rules:
10+
quotes:
11+
- error
12+
- double
13+
no-unsafe-negation:
14+
- off
15+
max-nested-callbacks:
16+
- off
17+
arrow-parens:
18+
- off
19+
filenames/match-regex:
20+
- off

Example/AndroidExample/.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"printWidth": 100,
3+
"singleQuote": true
4+
}

Example/AndroidExample/App.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ export default class App extends Component<{}, State> {
5353
hasLoggedInOnce: true,
5454
accessToken: authState.accessToken,
5555
accessTokenExpirationDate: authState.accessTokenExpirationDate,
56-
refreshToken: authState.refreshToken
56+
refreshToken: authState.refreshToken,
57+
scopes: authState.scopes
5758
},
5859
500
5960
);
@@ -107,6 +108,8 @@ export default class App extends Component<{}, State> {
107108
<Form.Value>{state.accessTokenExpirationDate}</Form.Value>
108109
<Form.Label>refreshToken</Form.Label>
109110
<Form.Value>{state.refreshToken}</Form.Value>
111+
<Form.Label>Scopes</Form.Label>
112+
<Form.Value>{state.scopes.join(', ')}</Form.Value>
110113
</Form>
111114
) : (
112115
<Heading>{state.hasLoggedInOnce ? 'Goodbye.' : 'Hello, stranger.'}</Heading>

Example/Latest/App.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ export default class App extends Component<{}, State> {
5353
hasLoggedInOnce: true,
5454
accessToken: authState.accessToken,
5555
accessTokenExpirationDate: authState.accessTokenExpirationDate,
56-
refreshToken: authState.refreshToken
56+
refreshToken: authState.refreshToken,
57+
scopes: authState.scopes
5758
},
5859
500
5960
);
@@ -107,6 +108,8 @@ export default class App extends Component<{}, State> {
107108
<Form.Value>{state.accessTokenExpirationDate}</Form.Value>
108109
<Form.Label>refreshToken</Form.Label>
109110
<Form.Value>{state.refreshToken}</Form.Value>
111+
<Form.Label>scopes</Form.Label>
112+
<Form.Value>{state.scopes.join(', ')}</Form.Value>
110113
</Form>
111114
) : (
112115
<Heading>{state.hasLoggedInOnce ? 'Goodbye.' : 'Hello, stranger.'}</Heading>

Example/Latest/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def enableProguardInReleaseBuilds = false
9595

9696
android {
9797
compileSdkVersion rootProject.ext.compileSdkVersion
98-
buildToolsVersion rootProject.ext.buildToolsVersion
98+
buildToolsVersion '28.0.2'
9999

100100
defaultConfig {
101101
applicationId "com.appauthexample"

Example/Latest/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ buildscript {
1313
google()
1414
}
1515
dependencies {
16-
classpath 'com.android.tools.build:gradle:3.1.4'
16+
classpath 'com.android.tools.build:gradle:3.2.0'
1717

1818
// NOTE: Do not place your application dependencies here; they belong
1919
// in the individual module build.gradle files
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#Thu Jan 31 15:34:58 GMT 2019
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
34
zipStoreBase=GRADLE_USER_HOME
45
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
extends:
3+
- formidable/configurations/es6-react
4+
plugins:
5+
- jest
6+
env:
7+
jest/globals: true
8+
browser: true
9+
rules:
10+
quotes:
11+
- error
12+
- double
13+
no-unsafe-negation:
14+
- off
15+
max-nested-callbacks:
16+
- off
17+
arrow-parens:
18+
- off
19+
filenames/match-regex:
20+
- off
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"printWidth": 100,
3+
"singleQuote": true
4+
}

Example/iOSCarthageExample/App.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ export default class App extends Component<{}, State> {
5353
hasLoggedInOnce: true,
5454
accessToken: authState.accessToken,
5555
accessTokenExpirationDate: authState.accessTokenExpirationDate,
56-
refreshToken: authState.refreshToken
56+
refreshToken: authState.refreshToken,
57+
scopes: authState.scopes
5758
},
5859
500
5960
);
@@ -107,6 +108,8 @@ export default class App extends Component<{}, State> {
107108
<Form.Value>{state.accessTokenExpirationDate}</Form.Value>
108109
<Form.Label>refreshToken</Form.Label>
109110
<Form.Value>{state.refreshToken}</Form.Value>
111+
<Form.Label>Scopes</Form.Label>
112+
<Form.Value>{state.scopes.join(', ')}</Form.Value>
110113
</Form>
111114
) : (
112115
<Heading>{state.hasLoggedInOnce ? 'Goodbye.' : 'Hello, stranger.'}</Heading>

0 commit comments

Comments
 (0)