Giter Club home page Giter Club logo

basic's Introduction

basic

config

Declare Variable

  APP_NAME: '',
  APP_EMAIL: '',
  USER_TYPE: [{
    title: 'USER'
  }, {
    title: 'ADMIN'
  }]

routes

  {
    path: '/signup'
  },
  {
    path: '/signup_partner'
  },
  {
    path: '/verification/:email'
  },
  {
    path: '/login_verification/:username/:code'
  },
  {
    path: '/login'
  },
  {
    path: '/request_reset_password'
  },
  {
    path: '/reset_password/:username/:code'
  },
  {
    path: '/refer_register/:email/:code'
  },

index.js

Declare Variable

  otpDataHolder: {
    userInfo: null,
    data: null
  }

Methods

  checkOtp(setting){
    if(setting !== null){
      if(parseInt(setting.email_otp) === 1 || parseInt(setting.sms_otp) === 1){
        // ask otp code here
        $('#otpModal').modal({
          backdrop: 'static',
          keyboard: true,
          show: true
        })
      }else{
        this.proceedToLogin()
      }
    }else{
      this.proceedToLogin()
    }
  },
  proceedToLogin(){
    let userInfo = this.otpDataHolder.userInfo
    let data = this.otpDataHolder.data
    let profile = data[0].account_profile
    let checkout = data[0].checkout
    let plan = data[0].plan
    let notifSetting = data[0].notification_settings
    this.setUser(userInfo.id, userInfo.username, userInfo.email, userInfo.account_type, userInfo.status, profile, checkout, plan, notifSetting)
    ROUTER.push('/templates')
  }

Call checkOtp() during authentication

basic's People

Contributors

kennck avatar

Stargazers

Jason So avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.