Auth0
November 25, 2016 ยท View on GitHub
Pepperoni used to be bundled with Auth0 but it has been removed by popular request.
You can follow this guide to get it back.
Installation
First, get the react-native-lock npm package.
$ npm i -S react-native-lock@futurice/react-native-lock#feature/customizedTheme
Then link the package to IOS and Android builds with the link command:
$ react-native link react-native-lock
Usage
Configuration
If you don't want to use Auth0, or you want to take it into use later, you can skip this step for now.
-
Before you start you need to create a new application in Auth0
-
Set
AUTH0_CLIENT_IDandAUTH0_DOMAINinenv.jsaccording to your application you created in AuthAUTH0_CLIENT_ID: '<CLIENT_ID>', AUTH0_DOMAIN: '<ACCOUNT_NAME>.eu.auth0.com' -
Follow the steps for your platform below. Check the official instructions for more information.
Customization
iOS
- Change default values in the customiseTheme method in
src/services/auth0.js - If you want to add images, copy them in the root
imagesfolder and add them via Xcode > file > add files to the project in 3 different resolutions (needs to be original and x2 and x3 versions) - All changeable values can be retrieved here
Android
- Change default values for the AppTheme.Lock in
android/app/src/main/res/values/styles.xml - Add images in
android/app/src/main/res/mipmap-<hdpi|mdpi|xhdpi|xxhdpi>in 4 different resolutions - All changeable values can be retrieved here
Example
You can see example of code used in Pepperoni when Auth0 was still bundled here.
The files you'll be interested in are: