README
hf-passports
Installation
yarn add hf-passport
Example
import React from 'react'
import ReactDOM from 'react-dom'
import Login from 'hf-passport'
function Example() {
function handleSucess(token) {
console.log(token)
}
return (
<Login
iframeUrl={iframeUrl}
passportUrl={passportUrl}
iframeWidth="400px"
iframeHeight="500px"
onSuccess={handleSucess}
/>
)
}
ReactDOM.render(<Example />, container)
Prop Types
Property | Type | Default | Description |
---|---|---|---|
iframeUrl | string | The url of iframe | |
passportUrl | string | The baseUrl of passport | |
iframeWidth | string | '400px' | The width of iframe |
iframeheight | string | '500px' | The height of iframe |
onSuccess | Function | Callback function with token parameter after successful login |
Contributing
- git clone git@git.hellorf.work:fe/hf-passport.git
- cd hf-passport && npm install && npm run build && npm start