Authentication
We're using useAuth for authentication.
- Setup a new Auth0 app
- Follow instructions in getting started docs
- Block twitshot access after 5 pics (use localstorage)
Authentication is not super necessary for this app, but it gives paying users the peace of mind that they're logged in. It also enables session sharing between devices.
And it's a good excuse to try it out :)
User roles
We'll need user roles later. Create a Rule on Auth0 to ensure role info is included with user data.
function (user, context, callback) {const namespace = 'https://YOUR_DOMAIN';const assignedRoles = (context.authorization || {}).roles;user.user_metadata = user.user_metadata || {};user.user_metadata.roles = assignedRoles;context.idToken[namespace + '/user_metadata'] = user.user_metadata;callback(null, user, context);}