-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
32 lines (27 loc) · 910 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import React from 'react';
import { Button, Platform, SafeAreaView } from 'react-native';
import { AppAuth } from 'expo';
const bundleIdentifier = 'expo.app.auth.test';
const auth0ClientId = '5swB8yUAHLD4ackTE1NDujImSRcQ0IAd';
const auth0Domain = 'expo-app-auth-test.eu.auth0.com';
const config = {
issuer: `https://${auth0Domain}`,
scopes: ['openid profile'],
clientId: auth0ClientId,
redirectUrl: `${bundleIdentifier}://${auth0Domain}/${Platform.OS}/${bundleIdentifier}/callback`
};
export default class App extends React.Component {
login = () => {
console.log('config:', JSON.stringify(config, null, 2));
AppAuth.authAsync(config)
.then(response => console.log('resolved', response))
.catch(error => console.log('error', error));
};
render() {
return (
<SafeAreaView>
<Button title="Login" onPress={this.login} />
</SafeAreaView>
);
}
}