Socket
Socket
Sign inDemoInstall

fl-auth-react

Package Overview
Dependencies
5
Maintainers
1
Versions
124
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fl-auth-react

React/redux-form login+register forms for FounderLab apps


Version published
Weekly downloads
192
increased by1180%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Ready made forms for use with fl-auth-redux and fl-auth-server

Part of fl-auth-*, an auth package for frameworkstein apps

Usage:


    // Ensure that the auth reducer from fl-auth-redux is in place

    import { login, register } from 'fl-auth-redux'
    import { LoginForm, RegisterForm } from 'fl-auth-react'

    ...
    @connect(state => {auth: state.auth}, {login, register})
    class LoginExample extends React.Component {

      handleLogin = data => {
        // data here contains an email & password from LoginForm
        this.props.login('/login', data.email, data.password, err => {
          // Redirect somewhere once logged in
        })
      }

      handleRegister = data => {
        // data here contains an email & password from RegisterForm
        this.props.register('/register', data, err => {
          // Redirect somewhere after registration
        })
      }

      render() {
        const { auth, onSubmit } = this.props

        return (
          <div>
            <LoginForm auth={auth} onSubmit={handleLogin} />
            <RegisterForm auth={auth} onSubmit={handleRegister} />
          </div>
        )
      }
    }

FAQs

Last updated on 05 Oct 2023

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc