jesse
04/11/2017, 5:13 PMmanager, associate), and I have a separate single-page React app for each user type (i.e., manager app, associate app). For a serverless architecture using JWT for authentication (e.g., Graphcool & Auth0), 1) where does the logic to check for authentication reside (i.e., check if user authenticated; if not, redirect to /login page) and 2) where does the logic to determine which app to load reside (i.e., if user is authenticated, check userType in JWT and load either manager app or associate app? Any help is much appreciated!nilan
04/11/2017, 6:43 PMquery {
# is null for wrong or no JWT in authorization header
user {
id
}
}
now in your app you would need to run this query, and depending on the result redirect to /login
2) the information would not reside inside the JWT, but rather on the user node in your Graphcool project. So a user could have a role, that would either be MANAGER or ASSOCIATE. the role can once again be queried using the user query:
query {
user {
id
role
}
}jesse
04/11/2017, 6:47 PMmanager app and associate app are different though (and in different repos, entirely). Is your suggestion to have a higher-level auth app that does this check and then loads the correct functional app (i.e., manager app vs associate app), if auth = true and userType = manager | associate? Thanks again!nilan
04/11/2017, 6:49 PMjesse
04/11/2017, 6:52 PMjesse
04/11/2017, 6:52 PMnilan
04/11/2017, 6:53 PM