1.2.1 • Published 3 months ago

nimblelab-react-login-google v1.2.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

nimblelab-react-login-google

LoginGoogle is a component for React. Displays a button to authenticate with google login. It takes care of pasting it to the google api and to our backend to check authentication. You only have to pass it the url of our server.

Installation

npm i nimblelab-react-login-google  # using npm

Example

In the root file

import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App.tsx';
import { GoogleOAuthProvider } from 'nimblelab-react-login-google';
import './index.scss';

const clientIdGoogle = '*****'; //clientId provided by the google application

ReactDOM.createRoot(document.getElementById('root')!).render(
  <React.StrictMode>
    <GoogleOAuthProvider clientId={clientIdGoogle}>
      <App />
    </GoogleOAuthProvider>
  </React.StrictMode>,
);

Where we want to use the component

import React from 'react';
import BasicLayout from '@/layout/basicLayout';
import { LoginGoogle } from 'nimblelab-react-login-google';

export default function Login() {
  return (
    <BasicLayout>
      <h1>Get started</h1>
      <LoginGoogle urlApiAuth={`http://localhost:3000/users/google/auth`} onSucces={() => navigate('/')} />
    </BasicLayout>
  );
}
1.2.0

3 months ago

1.0.18

3 months ago

1.0.17

3 months ago

1.2.1

3 months ago

1.0.16

3 months ago

1.0.15

3 months ago

1.0.14

3 months ago

1.0.13

3 months ago

1.0.12

3 months ago

1.0.11

3 months ago

1.0.10

3 months ago

1.0.9

3 months ago

1.0.8

3 months ago

1.0.7

3 months ago

1.0.6

3 months ago

1.0.5

3 months ago

1.0.4

3 months ago

1.0.3

3 months ago

1.0.2

3 months ago

1.0.1

3 months ago

1.0.0

3 months ago