1.3.2 • Published 4 years ago

podauth v1.3.2

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years 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.

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.31

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.10

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.0.3

6 years ago

0.0.21

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago