@ingenuity-labs/react-native-auth-module

1.0.0 • Public • Published

react-native-auth-module NPM version Build Status

An Authentication Module using react-native-api-client-wrapper

Dependencies

$ npm install --save react-native-api-client-wrapper

Installation

$ npm install --save react-native-auth-module

Usage

the AuthManager has 3 parameters. 1.) facebook_secretkey generated from facebook dev for Facebook Login 2.) GoogleAndroidClientID generated from google API for social auth google email Login 3.) GoogleIOSClientID generated from google API for social auth google email Login

import {AuthManager} from 'react-native-auth-module'
import {Constants} from 'your-constants'

let authManager;
  componentWillMount() {
    /**
     * Initialize the AuthManager
     * preferably during will mount method
     **/
    this.authManager = new AuthManager(
      Constants.Facebook.SECRET_KEY,
      Constants.Gmail.ANDROID.CLIENT_ID,
      Constants.Gmail.IOS.CLIENT_ID
    )
  }

this.authManager.expoFacebookLogin(Constants.Facebook.API_ENDPOINT)
.then((response) => {
  
}).catch((error) => {

})

##Functions

  expoFacebookLogin(APIEndpoint) {
  /**
   * accepts an APIEndpoint param of your APIServer
   * returns a Token that will send to the APIEndpoint
   **/
  }

  expoGoogleLogin(APIEndpoint) {
  /**
   * accepts an APIEndpoint param of your API Server
   * returns a token that will send to the APIEndpoint
   **/
  }

  credentialsLogin(loginUrl, username, password) {
  /**
   * default login usage
   * loginUrl = Login APIEndpoint of your API Server
   * username, password
   * returns a Token which you can access by .then((resposne) => {response.key})
   **/
  }

  changePassword(Token, url, old_password, new_password, confirm_password) {
  /**
   * accepts a Token from your Account, can be null depends on your API Server
   * url = APIendpoint for your changepassword
   **/
  }

  resetPassword(resetPasswordUrl, email) {
  /**
   * resetPasswordUrl param = APIEndpoint of your reset password
   * email = email used in your account to send the details of your new password
   **/
  }

  signUp(signUpUrl, params = {}) {
  /**
   * signUpUrl = APIEndpoint where you send the params object
   * params = object type parameter that will send the details of your registration
   * ex: {
   * username: username,
   * password; password,
   * email: email
   * }
   **/
  }

License

ISC © Redmond Job V. Perez

Package Sidebar

Install

npm i @ingenuity-labs/react-native-auth-module

Weekly Downloads

0

Version

1.0.0

License

ISC

Last publish

Collaborators

  • ingenuity-dev
  • jasonjonecarreos
  • mondeee
  • jeremy-ingenuity