1.0.0-alpha.28 • Published 1 month ago

@concepta/react-auth-provider v1.0.0-alpha.28

Weekly downloads
-
License
BSD-3-Clause
Repository
-
Last release
1 month ago

@rockets-react/auth-provider

Rockets Auth package to handle all authentication needs of your application.

IMPORTANT

When building your Auth system, you need to remember these!

This module only helps you to handle auth on your application. There is no magic, you are still responsible for having a SignIn/Signup screen and maitaing the state and routes of your application.

Here is how it works

This package will expose the following

  • A provider and a hook to access auth information like user data, tokens
  • Methods to make the Login and Logout funcionalities

Make sure you configured correctly the DataProvider before using the auth provider

  • Add your baseUrl with the \ or via ENV file with a variable named NEXT_PUBLIC_API_URL.

Examples

These are very rough examples. We intend to improve them ASAP.

Simple User Login

import { AuthProvider, useAuth } from '@concepta/auth-provider';

const AppWrapper = () => {
  const { doLogin, user } = useAuth();

  const onClickSignIn = async (user: string, password: string) => {
    doLogin({ email: user, password });
  };

  return (
    <AuthProvider>
      {user ? (
        <div>LOGGED IN!</div>
      ) : (
        <SimpleLoginForm onClickSignIn={onClickSignIn} />
      )}
    </AuthProvider>
  );
};
1.0.0-alpha.28

1 month ago

1.0.0-alpha.27

1 month ago

1.0.0-alpha.26

3 months ago

1.0.0-alpha.25

3 months ago

1.0.0-alpha.24

3 months ago

1.0.0-alpha.23

4 months ago

1.0.0-alpha.22

4 months ago

1.0.0-alpha.21

4 months ago

1.0.0-alpha.20

5 months ago

1.0.0-alpha.19

5 months ago

1.0.0-alpha.18

5 months ago

1.0.0-alpha.17

5 months ago

1.0.0-alpha.16

5 months ago

1.0.0-alpha.12.1

6 months ago

1.0.0-alpha.8

7 months ago

1.0.0-alpha.7

8 months ago

1.0.0-alpha.6

8 months ago

1.0.0-alpha.10

7 months ago

1.0.0-alpha.15

6 months ago

1.0.0-alpha.12

6 months ago

1.0.0-alpha.11

6 months ago

1.0.0-alpha.14

6 months ago

1.0.0-alpha.13

6 months ago

1.0.0-alpha.5

1 year ago

1.0.0-alpha.3

1 year ago

1.0.0-alpha.2

1 year ago

1.0.0-alpha.1

2 years ago