margaretkrutikova / bs-react-netlify-identity Goto Github PK
View Code? Open in Web Editor NEWReason bindings for react-netlify-identity
Home Page: https://bs-react-netlify-identity.netlify.com/
License: MIT License
Reason bindings for react-netlify-identity
Home Page: https://bs-react-netlify-identity.netlify.com/
License: MIT License
It is currently impossible to test the UI for logged in and anonymous users unless actually deploying everything in production and testing there.
One suggestion would be to expose some TestContext
where you could provide your own mocked version of the context.
According to the source code of react-netlify-identity
isLoggedIn
is derived from the user
object (https://github.com/sw-yx/react-netlify-identity/blob/master/src/index.tsx#L353) which means it should be mapped to a variant in reason
. Smth like this:
type t('a) =
| Anonymous
| LoggedInUser(NetlifyUser.t('a));
Since Netlify passes roles as an array in the app_metadata
field on the user
object, it would be great to be able to access it via reason bindings:
https://github.com/netlify/gotrue-js/blob/master/index.d.ts#L87
Here is the relevant Netlify documentation on roles:
https://www.netlify.com/docs/identity/#identity-user-metadata
"app_metadata": {"roles": ["investigator", "photographer"]}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.