🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

loginplify

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loginplify

React components to help you integrate a login flow into your application.

latest
npmnpm
Version
0.0.20
Version published
Maintainers
1
Created
Source

Getting Started

NOTE: Please make sure you have deployed your Loginplify server before using this component library

Installation

$ npm i loginplify

Add authentication on a page on your React application

import * as React from 'react'
import { withAuthenticator } from 'loginplify'

const settings = {
  endpoint: 'https://loginplify.mydomain.se/graphql'
}

const ProtectedPage = () => {
  return (
    <div>
      <h1>This is private content</h1>
    </div>
  )
}

export default withAuthenticator(ProtectedPage, settings)

Logout

import * as React from 'react'
import { withAuthenticator, useLoginServiceContext } from 'loginplify'

const settings = {
  endpoint: 'https://loginplify.mydomain.se/graphql'
}

const ProtectedPage = () => {
  const { actions } = useLoginServiceContext()

  return (
    <div>
      <h1>This is private content</h1>
      <button onClick={() => actions.logout()}>Logout</button>
    </div>
  )
}

export default withAuthenticator(ProtectedPage, settings)

FAQs

Package last updated on 02 May 2020

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