-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Moodle Course Completion Webhooks #4
base: main
Are you sure you want to change the base?
Conversation
The only thing that remains is a way to easily define course_id => group_id. I don't think the source of truth for this map should be stored here and maybe inside Moodle itself |
log.Printf("user %s completed moodle course %s", user.Email, body.CourseID) | ||
} | ||
|
||
err = kc.AddUserToGroup(r.Context(), user.ID, "6e413212-c1d8-4bc9-abb3-51944ca35327") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider exposing the group ID as an env var in case it ever changes
@@ -100,6 +100,40 @@ func (k *Keycloak) GetUser(ctx context.Context, userID string) (*User, error) { | |||
} | |||
|
|||
user := &User{ | |||
ID: gocloak.PString(kcuser.ID), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary in this PR, but it would be nice to move the gocloak.User
-> User
conversion logic into a helper function to avoid duplication.
Co-authored-by: Jordan Olshevski <[email protected]>
No description provided.