Skip to content

Blibli.com Login-Register Validation Helper in Javascript

License

Notifications You must be signed in to change notification settings

bliblidotcom/blibli-login-helper

Repository files navigation

blibli-login-helper

Blibli.com Login-Register Validation Helper in Javascript

License Github Issue GitHub Fork GitHub Star GitHub Contributors

How to import

// just import anything you need
import {checkEmailError, checkPasswordError, failedHandler, FBinitialize, loginFacebook} from 'blibli-login-helper'

Available Methods

/**
 * Validating email format
 * @param {string} email string
 *
 * @return {boolean} true if valid
 */

 validateEmail(string)
/**
 * checkEmailError for email format
 * @param {string} email string
 * @param {Object} self/this from component
 *
 * @return {boolean} true if valid
 */

 checkEmailError(string, self)
/**
 * Validating password format
 * @param {string} password string
 *
 * @return {string} error code when not valid
 */

validatePassword(string) 
/**
 * checkPasswordError for password format
 * @param {string} password string
 * @param {Object} self/this from component
 *
 * @return {string} empty if valid
 */

 checkPasswordError(string, self)
/**
 * Get all error data with empty set
 *
 * @return {Object} error object with empty data
 */

 getEmptyError()
/**
 * Handle error code in login/register from backend
 * @param {Object} response body from backend
 * @param {Object} self/this from component
 *
 * @return {Object} error object that assign to error data
 */

failedHandler(response, self)
/**
 * Initialize facebook SDK
 * @param {string} facebookAppId
 *
 * void
 */

FBinitialize(facebookAppId)
/**
 * Login with Facebook SDK
 * @param {Function} submitFn
 *
 * void
 */

loginFacebook(submitFn)

About

Blibli.com Login-Register Validation Helper in Javascript

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •