0.0.20 • Published 4 years ago
loginplify v0.0.20
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
4 years ago
0.0.19
4 years ago
0.0.18
4 years ago
0.0.17
4 years ago
0.0.16
5 years ago
0.0.15
5 years ago
0.0.14
5 years ago
0.0.13
5 years ago
0.0.12
5 years ago
0.0.11
5 years ago
0.0.10
5 years ago
0.0.9
5 years ago
0.0.8
5 years ago
0.0.7
5 years ago
0.0.6
5 years ago
0.0.5
5 years ago
0.0.4
5 years ago
0.0.3
5 years ago
0.0.2
5 years ago
0.0.1
5 years ago