Skip to content

Commit aa5c31e

Browse files
authored
fixing jwt issue (#108)
* adding CFR example and showing examples based on CFR status in config file * fixing flow so CFR examples show without config value * fixing examples that need to reroute when cfr enabled * fixes * moving CFR error text in manifest * adding support for quickstart * quickacg fix * adding later changes to working auth branch
1 parent 65ee017 commit aa5c31e

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

index.js

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const {
3434

3535
const {
3636
eg001click, eg002click, eg003click,
37-
eg004click, eg005click, eg006click
37+
eg004click, eg005click, eg006click,
3838
} = require("./lib/click/controllers");
3939

4040
const {

lib/click/examples/embedClickwrap.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,4 @@ const getInactiveClickwraps = async (args) => {
8181
return await accountApi.getClickwraps(args.accountId, {status: 'inactive'});
8282
}
8383

84-
module.exports = { getInactiveClickwraps, getActiveClickwraps, embedClickwrap };
85-
84+
module.exports = { getInactiveClickwraps, getActiveClickwraps, embedClickwrap };

lib/commonControllers.js

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,27 @@ commonControllers.indexController = async (req, res) => {
3333
});
3434
}
3535
else if (req.dsAuth.checkToken(3)){
36-
let enableCFR = await isCFR(req.user.accessToken, req.session.accountId, req.session.basePath);
37-
if (enableCFR == "enabled"){
38-
res.locals.statusCFR = "enabled";
36+
if (req.session.accountId == undefined) {
37+
let enableCFR = await isCFR(req.user.accessToken, req.user.accountId, req.user.basePath);
38+
if (enableCFR == "enabled"){
39+
res.locals.statusCFR = "enabled";
40+
}
41+
res.render('pages/index', {
42+
title: "Home",
43+
documentation: dsConfig.documentation + documentationTopic,
44+
showDoc: dsConfig.documentation
45+
});
46+
} else {
47+
let enableCFR = await isCFR(req.user.accessToken, req.session.accountId, req.session.basePath);
48+
if (enableCFR == "enabled"){
49+
res.locals.statusCFR = "enabled";
50+
}
51+
res.render('pages/index', {
52+
title: "Home",
53+
documentation: dsConfig.documentation + documentationTopic,
54+
showDoc: dsConfig.documentation
55+
});
3956
}
40-
res.render('pages/index', {
41-
title: "Home",
42-
documentation: dsConfig.documentation + documentationTopic,
43-
showDoc: dsConfig.documentation
44-
});
4557
}
4658
else {
4759
res.render('pages/index', {

0 commit comments

Comments
 (0)