Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit 82a0b76

Browse files
committed
Add LMS support for Parent-guardian
1 parent 42d3183 commit 82a0b76

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/users/lms/get-lms-link.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function getLMSLink (args, cb) {
3434
*/
3535
function getUser (waterfallCb) {
3636
var userTypes = [];
37-
var allowedUserTypes = ['mentor', 'champion'];
37+
var allowedUserTypes = ['mentor', 'champion', 'parent-guardian'];
3838
seneca.act({role: 'cd-profiles', cmd: 'load_user_profile', userId: user.id},
3939
function (err, profile) {
4040
userTypes = [profile.userType];
@@ -45,7 +45,7 @@ function getLMSLink (args, cb) {
4545
userTypes = _.intersection(userTypes, allowedUserTypes);
4646
if (!_.isEmpty(userTypes)) {
4747
if (_.isEmpty(user.lmsId)) {
48-
if(!_.isEmpty(args.approval)){
48+
if (!_.isEmpty(args.approval)) {
4949
// The user doesn't exists yet on the LMS, we create it to save the corresponding Id
5050
request.post(APIUrl + 'users', {
5151
auth: {
@@ -143,7 +143,7 @@ function getLMSLink (args, cb) {
143143
function buildURL (waterfallCb) {
144144
var email = user.email;
145145
var userName = user.name;
146-
var baseUrl = 'https://coderdojo.learnupon.com/sqsso';
146+
var baseUrl = process.env.LMS_URL;
147147
var TS = Date.now();
148148
hash.update('USER='+ email +'&TS='+ TS +'&KEY='+ APIKey);
149149
var SSOToken = hash.digest('hex');

0 commit comments

Comments
 (0)