2.0.10 • Published 2 days ago

podauth2 v2.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
2 days 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.10

2 days ago

2.0.9

17 days ago

2.0.7

18 days ago

2.0.8

18 days ago

2.0.5

18 days ago

2.0.6

18 days ago

2.0.3

23 days ago

2.0.2

23 days ago

2.0.4

22 days ago

1.3.14

23 days ago

2.0.1

23 days ago

2.0.0

23 days ago

1.3.13

1 month ago

1.3.12

1 month ago

1.3.11

2 months ago

1.3.9

1 year ago

1.3.8

1 year ago

1.3.7

1 year ago

1.3.6

1 year ago

1.3.5

1 year ago

1.3.4

1 year ago

1.3.3

1 year ago