Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Feature/jwt auth (WIP) #76

Open
wants to merge 70 commits into
base: master
Choose a base branch
from
Open

Feature/jwt auth (WIP) #76

wants to merge 70 commits into from

Conversation

ericzon
Copy link
Contributor

@ericzon ericzon commented May 7, 2020

image

PR Description

Added a jwt auth using hapi-auth-jwt2

Auth endpoints (examples added in README):

/api/auth/register (POST with email & password fields) <-- foreign scope as default. To be able to login, admin needs to change it to 'collaborator'
/api/auth/login (POST with email & password fields)

If you need to check some information inside token payload, you can access through request.auth field.

.env cfg

JWT_SECRET=
EXPIRY_TIME_SECONDS=

To modify scopes, check Hapi documentation about scope in the code, you can set scopes through feat files (server/feats/{resource}/{resource}.feat.js)

P.S: public folder is not yet regenerated to ease the PR review

eric-lara and others added 30 commits May 7, 2020 09:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants