Socket
Socket
Sign inDemoInstall

@moxb/shards-accounts-flow-antd

Package Overview
Dependencies
83
Maintainers
4
Versions
46
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @moxb/shards-accounts-flow-antd

Shards: basic user login flow with ant design UI


Version published
Maintainers
4
Install size
5.67 MB
Created

Readme

Source

Shards - User Login workflow with Ant Design

This package provides a very basic solution for common user account workflows.

This is considered to be W.I.P.

Assumptions:

  • You are building a React application
  • Client-side routing is provided by Stellar Router
  • You want to use Ant Design for the UI

Features

  • If the user is trying to access a restricted part of the application, and is not logged in, he will be automatically redirected to the login form.
  • User login, registration, password reset request and password reset are supported.
  • After successful login, the user is redirected to the original location he tried to visit.

Quick start

Client side:

Basic app integration:

// This is for routing, not for accounts
import {SimpleLoginApp} from './WithLoginFlow';

const routingStore = createRoutingStore();

// you need to bring your Auth Backend
const authBackedn = new RandomAuthBackend();

// We will use this on the login form
const Splash = () => <h1>Welcome to my app!</h1>;

export const App = () => (
    <StellarRouterProvider store={routingStore}>
        <SingleLoginApp splash={<Splash/> backend={authBackend}}>
            <MainAppLayout/>
        </SingleLoginApp>
    </StellarRouterProvider>
);
  • It's also possible to arrange it so that some part of the app is available without login, but a restricted part is not. In that case, wrap the root of the app with <WithLoginFlow>, and the restricted part with <OnlyUsers>.
  • There is also <LogoutButton /> that you can use for logging out.

See also

  • The UI used by this package is shipped in @moxb/shards-accounts-ui-antd.
  • An example auth backend if provided by @moxb/shards-accounts-meteor.

Keywords

FAQs

Last updated on 14 Dec 2022

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