0.0.20 • Published 8 months ago
react-alohomora v0.0.20
React Alohomora
Authorization Component For React JS
You can manage role based authorization with this package. Define keys according to user roles then give them to context provider. You can define secure fields with Alohomora component that only displays if the keys given to it match the keys from the context provider
Main Branch is the newest version
npm i react-alohomora
import React from "react";
import { Alohomora, AlohomoraContext } from "react-alohomora";
const App = () => {
return (
<AlohomoraContext.Provider value={{ keys: ["hogwarts.headmaster"] }}>
<Alohomora keys={["ministryOfMagic.minister", "hogwarts.headmaster"]}>
Forbidden Forest
</Alohomora>
<Alohomora keys={["ministryOfMagic.minister"]}>
Department Of Mysteries
</Alohomora>
</AlohomoraContext.Provider>
);
};
0.0.20
8 months ago
0.0.19
8 months ago
0.0.18
8 months ago
0.0.17
8 months ago
0.0.16
8 months ago
0.0.15
8 months ago
0.0.14
8 months ago
0.0.13
8 months ago
0.0.12
8 months ago
0.0.11
8 months ago
0.0.10
8 months ago
0.0.9
8 months ago
0.0.8
8 months ago
0.0.7
8 months ago
0.0.6
8 months ago
0.0.5
8 months ago
0.0.4
8 months ago
0.0.3
8 months ago
0.0.2
8 months ago
0.0.1
8 months ago