cognito-session-setter
v0.0.1
Published
Create a Cognito session in storage for given access, id and refresh tokens
Downloads
4
Maintainers
Readme
Cognito Session Setter
Create a Cognito session in storage for given access, id and refresh tokens
Installation
npm install cognito-session-setter
Usage
import setSession from 'cognito-session-setter';
const params = new URL(document.location).searchParams;
const clientId = params.get('clientId'); // Required
const username = params.get('username'); // Required
const accessToken = params.get('accessToken'); // Optional
const idToken = params.get('idToken'); // Optional
const refreshToken = params.get('refreshToken'); // Optional
if (clientId && username) {
setSession({
clientId,
username,
accessToken,
idToken,
refreshToken
});
}