2.0.14 • Published 1 year ago

podauth2 v2.0.14

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Podauth

Podauth handle async pod auth actions

Build

npm run build

Installation

npm install podauth --save

Usage

React component:

import {auth} from "podauth"

auth({
    clientId: "aja73hq234hsflksfgsiuaevjtl",//Business client id
    ssoBaseUrl: "https://accounts.pod.land/oauth2",//sso Base Url
    redirectUri: "https://example.com",//Default {protocol}://{domain} of current url
    timeRemainingTimeout: 90,//Remaining time before expiration to refresh token, Default 90 seconds before expiration
    retryTimeout: 3000,//Retry timeout after a fail catch
    cookieTimeout: 365,//Cookie timeout for refresh token
    scope: "profile",//Login scope: profile|email|address|activity|legal،|phone
    onRetry(retry){
      //Will fire when getting toke failed or canceled {retry} is custom retry function
    },
    onError(){
      //Will fire when an error happened
      return true;//will go to login page if you return true except will do nothing
    },
    onNewToken(token){
      //Do your stuff
    },
    redirectTrigger(){
      //Will fire when auth will be in sign out or token generation faze 
      //When you define this function needs to return true for default redirection to login page
      //If you dont need to default redirection you can return false or nothing
      return true;
    }
})

License

This project is open-sourced software licensed under the MIT license.

2.0.13

1 year ago

2.0.14

1 year ago

2.0.11

1 year ago

2.0.12

1 year ago

2.0.10

1 year ago

2.0.9

1 year ago

2.0.7

1 year ago

2.0.8

1 year ago

2.0.5

1 year ago

2.0.6

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.4

1 year ago

1.3.14

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.3.13

1 year ago

1.3.12

1 year ago

1.3.11

1 year ago

1.3.9

2 years ago

1.3.8

2 years ago

1.3.7

2 years ago

1.3.6

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago