Skip to content

Latest commit

 

History

History
61 lines (40 loc) · 3.56 KB

AUTH0.md

File metadata and controls

61 lines (40 loc) · 3.56 KB

Auth0

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.

  1. Before you start you need to create a new application in Auth0

  2. Set AUTH0_CLIENT_ID and AUTH0_DOMAIN in env.js according to your application you created in Auth

     AUTH0_CLIENT_ID: '<CLIENT_ID>',
     AUTH0_DOMAIN: '<ACCOUNT_NAME>.eu.auth0.com'
    
  3. 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 images folder 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: