0.0.20 • Published 6 years ago

loginplify v0.0.20

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

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

6 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago