frontend-authentication-module
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

Authentication Library

Handles authentication on grub eco system

Installation

npm install @grubtech/auth-library

Usaged

aws-amplify needs an amplify configuration

const amplifyConfig = {
  Auth: {
    region: process.env.REACT_APP_AWS_REGION,
    identityPoolRegion: process.env.REACT_APP_IDENTITY_POOL_REGION,
    userPoolId: process.env.REACT_APP_USER_POOL_ID,
    userPoolWebClientId: process.env.REACT_APP_USER_POOL_WEB_CLIENT_ID,
  },
};

export default amplifyConfig;

Initiate an Authentication with the amplifier config

import {AuthenticationService} from '@grubtech/auth-library';
import amplifyConfig from "./amplifyConfig";

export const authObj = new AuthenticationService(amplifyConfig);

now use the 'authObj' as needed

import {authObj} from '../../../configs/authConfig';
const authResponse = await authObj.loginUser(values.email, values.password);

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

Grubtech

Readme

Keywords

none

Package Sidebar

Install

npm i frontend-authentication-module

Weekly Downloads

0

Version

1.0.9

License

Grubtech

Unpacked Size

26 kB

Total Files

22

Last publish

Collaborators

  • smanorathna