2.0.0-alpha.6 • Published 4 years ago

@vseth/auth v2.0.0-alpha.6

Weekly downloads
42
License
MIT
Repository
-
Last release
4 years ago

vseth-auth

NPM Package for Auth Helper

useAuth

React Hook. TODO docs, look at the src

Authprovider

The Authprovider provides the context for the hook, it need to be at the root or close to it and there should only be one.

Protected Route

A wrapped react-router-dom route component that checks wheter the user has sufficient priviledge to access this route and otherwise displays an error

Usage example

const App: React.FunctionComponent<any> = () => {
  return (
    <AuthProvider>
      <Router>
        <Switch>
          <Route path="/">
            <p>Unprotected</p>
          </Route>
          <ProtectedRoute path="/protected">
            <p>Protected</p>
          </ProtectedRoute>
        </Switch>
      </Router>
    </AuthProvider>
  );
};
2.0.0-alpha.6

4 years ago

2.0.0-alpha.5

4 years ago

2.0.0-alpha.4

4 years ago

0.0.16

4 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago