New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@bung87/authflow

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bung87/authflow

authflow provide three steps login defined in `AuthFlowActions`

latest
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

authflow

authflow provide three steps login defined in AuthFlowActions

  • loginRequest: auth info post
  • codeRequest: verification code (eg. sms code handle)
  • statusRequest: refresh authed user info

Prepare

import { applyMiddleware } from 'redux'
import thunk from 'redux-thunk'
const store = createStore(reducer, applyMiddleware(thunk))

Useage

import { deferred, fetchLogin, fetchCode, fetchStatus, AuthFlowActions } from '@bung87/authflow'

function login() {
  return fetch('http://example.com/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({}),
  }).then((res: any) => res.json())
}

let dLogin = deferred(console.log)
store.dispatch(fetchLogin(dLogin))
dLogin.resolve(login())

FAQs

Package last updated on 07 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts