Closed dpfernandes closed 3 years ago
@dpfernandes I'm here at the study group with Nuha and it is a bit unclear to both of us what the specific work needed for this issue is. I think the work needed is to integrate with the Slack API but I could be wrong.
Questions:
/api/slack_users
in https://github.com/HackYourFuture-CPH/web-dev-rooms/pull/70 for now.Here's what I think the work needed is but please fill free to correct me or fill in missing pieces:
POST /api/slack/auth
Authorization
headerAnd lastly Daniel, it would be nice to understand in which context this endpoint will be used (which screens on the frontend).
This issue is to solve the authentication for the app using Slack authentication It should validate if the user has an account in our slack workspace and if the user is part of any user group so we know it’s part of a class or by default if it’s not they should be considered mentors
I think it’s fine if the endpoint just validates if the user has an account and returns the token
The screenshot is to show a user group
I think your approach it fine
Can you elaborate on the this “And lastly Daniel, it would be nice to understand in which context this endpoint will be used (which screens on the frontend).”?
Can you elaborate on this
Basically, I mean when would this endpoint be called, originated from which page on the frontend?
This is the desired behavior I understand from https://github.com/HackYourFuture-CPH/web-dev-rooms/issues/58#issuecomment-733660806:
POST /api/slack/auth
Request: { "slackUserId": "xyz" }
Response: { "slackUserId": "xyz", "name": "John Appleseed", "userGroups": [{ "id": "...", "name": "Class 15" }] }
It sounds like the Slack authentication token will come from an environment variable.
@dpfernandes Does this sound correct?
It seems right! :)
Any opinions @tpetrina and @bytewiz ?
Create an endpoint that uses the User's Slack ID and Token to authenticate with our app and retrieves the SlackID and Name of the user.
The endpoint could also retrieve the User groups that the specific user is part of, like the class user group.