Skip to content

Ready made forms for use with fl-auth-redux and fl-auth-server. Part of fl-auth-*, an auth package for frameworkstein apps

License

Notifications You must be signed in to change notification settings

founderlab/fl-auth-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This package has moved to the Frameworkstein repository


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>
        )
      }
    }

About

Ready made forms for use with fl-auth-redux and fl-auth-server. Part of fl-auth-*, an auth package for frameworkstein apps

Resources

License

Stars

Watchers

Forks

Packages

No packages published