Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Conversation

@ATechAdventurer
Copy link
Member

No description provided.

@ATechAdventurer ATechAdventurer changed the title Support/moodle Add support for Moodle Course Completion Webhooks Sep 16, 2023
@ATechAdventurer
Copy link
Member Author

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")
Copy link
Member

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

}

user := &User{
ID: gocloak.PString(kcuser.ID),
Copy link
Member

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.

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.

3 participants