0.1.7 • Published 8 months ago
@leapfinance/auth-kit v0.1.7
Leap Auth Kit
this is auth kit for generating token
Installation
yarn add @leapfinance/auth-kit
Getting Started
First, Keep this component in global level or where you want to access it
import { WithLogin } from "@leapfinance/auth-kit";//import
<WithLogin appName={application_name} apiPath={server_path} logo={componey_logo} /> // component
How to use
leapLogin
To initiate Login Form
// init login modal
leapLogin(loginOption)
loginOption
Name | Type | Description | Default |
---|---|---|---|
title | string | that need to show on login modal | null |
canClose | boolean | can login modal close | true |
phone | string | prefilled phone number | null |
callback | (token, options?: {phone, subscribedToWhatsapp}) =>void | when token generates successfully return token and options. | null |
canChangeCountryCode | boolean | enable multiple country selector | false |
logo | string | in case you want new logo on modal | null |
enableTrueCaller | boolean | enable truecaller login | true |
error
To show error message in modal
leapLogin.error("error message")
loader
To Show Loader in Login Form
leapLogin.error("error message")
login status
To check is Logged in
leapLogin.isLogin() // return boolean
logout
To logout or delete cookies
leapLogin.logout()
subscribe events
To subscribe events
leapLogin.subscribe(events,cb);
// where cb = (option?: LoginOptionDto) => void
subscribe events list
Event Name | Description |
---|---|
INIT_LOGIN | when Login form initiate |
GENERATE_OTP | when generate otp action initiate |
GENERATE_OTP_SUCCESS | when generate otp successfully |
RESEND_OTP | when resend otp action initiate |
RESEND_OTP_SUCCESS | when resent otp successfully |
LOGIN_WITH_TC | when login with truecaller |
SUBMIT_OTP_SUCCESS | when otp verify successfully |
LOGIN_SUCCESS | when login successfully |
0.1.1-SNAPSHOT-2-BETA-CA
9 months ago
0.1.2-SNAPSHOT-1-BETA
9 months ago
0.1.1-SNAPSHOT-2-BETA
10 months ago
0.1.2
9 months ago
0.1.7
8 months ago
0.1.1-SNAPSHOT-1-BETA
10 months ago
0.1.3
9 months ago
0.1.0
11 months ago
0.0.1-SNAPSHOT-10-BETA
11 months ago
0.0.1-SNAPSHOT-9-BETA
11 months ago
0.0.1-SNAPSHOT-8
2 years ago
0.0.1-SNAPSHOT-7
2 years ago
0.0.1-SNAPSHOT-6
2 years ago
0.0.1-SNAPSHOT-5
2 years ago
0.0.1-SNAPSHOT-4
2 years ago
0.0.1-SNAPSHOT-3
2 years ago
0.0.1-SNAPSHOT-2
2 years ago
0.0.1-SNAPSHOT-1
2 years ago