Skip to content

Commit f48a121

Browse files
authored
Merge pull request #33 from agoravoting/invalidCredentials
Invalid credentials
2 parents 057fec1 + 208e9f9 commit f48a121

23 files changed

+784
-815
lines changed

avRegistration/login-directive/login-directive.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,13 @@ angular.module('avRegistration')
147147
} else {
148148
scope.sendingData = false;
149149
scope.status = 'Not found';
150-
scope.error = $i18next('avRegistration.invalidCredentials');
150+
scope.error = $i18next('avRegistration.invalidCredentials', { support: ConfigService.contact.email });
151151
}
152152
})
153153
.error(function(error) {
154154
scope.sendingData = false;
155155
scope.status = 'Registration error: ' + error.message;
156-
scope.error = $i18next('avRegistration.invalidCredentials');
156+
scope.error = $i18next('avRegistration.invalidCredentials', { support: ConfigService.contact.email });
157157
});
158158
};
159159

avRegistration/login-directive/login-directive.less

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
text-align: center;
88
}
99

10+
.error.text-danger.ng-binding.ng-scope {
11+
white-space: pre;
12+
}
13+
1014
.help-h3 {
1115
margin-top: 0;
1216
}

dist/appCommon-v3.4.0.js

+15-11
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
113113
return fields;
114114
}, authmethod.getLoginFields = function(viewEventData) {
115115
var fields = authmethod.getRegisterFields(viewEventData);
116-
("sms" === viewEventData.auth_method || "email" === viewEventData.auth_method) && fields.push({
116+
"sms" !== viewEventData.auth_method && "email" !== viewEventData.auth_method || fields.push({
117117
name: "code",
118118
type: "code",
119119
required: !0,
@@ -180,7 +180,7 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
180180
attrs.code && attrs.code.length > 0 && (scope.code = attrs.code), scope.email = null,
181181
attrs.email && attrs.email.length > 0 && (scope.email = attrs.email), scope.isAdmin = !1,
182182
autheventid === adminId && (scope.isAdmin = !0), scope.resendAuthCode = function(field) {
183-
if (!scope.sendingData && "sms" === scope.method && -1 !== scope.telIndex && !scope.form["input" + scope.telIndex].$invalid) {
183+
if (!scope.sendingData && "sms" === scope.method && scope.telIndex !== -1 && !scope.form["input" + scope.telIndex].$invalid) {
184184
field.value = "";
185185
var data = {};
186186
data.tlf = scope.telField.value, scope.sendingData = !0, Authmethod.resendAuthCode(data, autheventid).success(function(rcvData) {
@@ -210,9 +210,13 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
210210
}) : angular.isDefined(rcvData["redirect-to-url"]) ? $window.location.href = rcvData["redirect-to-url"] : Authmethod.getPerm("vote", "AuthEvent", autheventid).success(function(rcvData2) {
211211
var khmac = rcvData2["permission-token"], path = khmac.split(";")[1], hash = path.split("/")[0], msg = path.split("/")[1];
212212
$window.location.href = "/booth/" + autheventid + "/vote/" + hash + "/" + msg;
213-
})) : (scope.sendingData = !1, scope.status = "Not found", scope.error = $i18next("avRegistration.invalidCredentials"));
213+
})) : (scope.sendingData = !1, scope.status = "Not found", scope.error = $i18next("avRegistration.invalidCredentials", {
214+
support: ConfigService.contact.email
215+
}));
214216
}).error(function(error) {
215-
scope.sendingData = !1, scope.status = "Registration error: " + error.message, scope.error = $i18next("avRegistration.invalidCredentials");
217+
scope.sendingData = !1, scope.status = "Registration error: " + error.message, scope.error = $i18next("avRegistration.invalidCredentials", {
218+
support: ConfigService.contact.email
219+
});
216220
});
217221
}
218222
}, scope.apply = function(authevent) {
@@ -223,7 +227,7 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
223227
return scope.stateData[el.name] ? (el.value = scope.stateData[el.name], el.disabled = !0) : (el.value = null,
224228
el.disabled = !1), "email" === el.type && null !== scope.email ? (el.value = scope.email,
225229
el.disabled = !0) : "code" === el.type && null !== scope.code ? (el.value = scope.code.trim().replace(/ |\n|\t|-|_/g, "").toUpperCase(),
226-
el.disabled = !0) : "tlf" === el.type && "sms" === scope.method && (null !== scope.email && -1 === scope.email.indexOf("@") && (el.value = scope.email,
230+
el.disabled = !0) : "tlf" === el.type && "sms" === scope.method && (null !== scope.email && scope.email.indexOf("@") === -1 && (el.value = scope.email,
227231
el.disabled = !0), scope.telIndex = index + 1, scope.telField = el), el;
228232
}), filled_fields = _.filter(fields, function(el) {
229233
return null !== el.value;
@@ -654,7 +658,7 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
654658
}
655659
var checkCollapse = function(instance, el, options) {
656660
var maxHeight = select(instance, el, instance.maxHeightSelector).css("max-height"), height = angular.element(el)[0].scrollHeight;
657-
if (-1 === maxHeight.indexOf("px")) return void console.log("invalid non-pixels max-height for " + instance.maxHeightSelector);
661+
if (maxHeight.indexOf("px") === -1) return void console.log("invalid non-pixels max-height for " + instance.maxHeightSelector);
658662
if (maxHeight = parseInt(maxHeight.replace("px", "")), height > maxHeight) {
659663
if (instance.isCollapsed) return;
660664
instance.isCollapsed = !0, collapseEl(instance, el).addClass("collapsed"), select(instance, el, instance.toggleSelector).removeClass("hidden in");
@@ -747,7 +751,7 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
747751
}
748752
if (void 0 === format && (format = "str"), 0 === total_votes) return print(0);
749753
var base = question.totals.valid_votes + question.totals.null_votes + question.totals.blank_votes;
750-
return (void 0 === over || null === over) && (over = question.answer_total_votes_percentage),
754+
return void 0 !== over && null !== over || (over = question.answer_total_votes_percentage),
751755
"over-valid-votes" === over && (base = question.totals.valid_votes), print(100 * total_votes / base);
752756
};
753757
}), angular.module("avUi").service("CheckerService", function() {
@@ -847,7 +851,7 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
847851
prefix: sumStrs(d.prefix, item.prefix)
848852
});
849853
}), !0));
850-
return pass || "chain" !== d.data.groupType ? !0 : !1;
854+
return !(!pass && "chain" === d.data.groupType);
851855
});
852856
return ret;
853857
}
@@ -856,8 +860,8 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
856860
return function(number, fixedDigits) {
857861
angular.isNumber(fixedDigits) && fixedDigits >= 0 && (number = number.toFixed(parseInt(fixedDigits)));
858862
var number_str = (number + "").replace(".", ","), ret = "", commaPos = number_str.length;
859-
-1 !== number_str.indexOf(",") && (commaPos = number_str.indexOf(","));
860-
for (var i = 0; commaPos > i; i++) {
863+
number_str.indexOf(",") !== -1 && (commaPos = number_str.indexOf(","));
864+
for (var i = 0; i < commaPos; i++) {
861865
var reverse = commaPos - i;
862866
reverse % 3 === 0 && reverse > 0 && i > 0 && (ret += "."), ret += number_str[i];
863867
}
@@ -867,7 +871,7 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
867871
return function(originString, searchString) {
868872
if (!angular.isString(originString) || !angular.isString(searchString)) return !1;
869873
var lastIndex = originString.indexOf(searchString);
870-
return -1 !== lastIndex && lastIndex === originString.length - searchString.length;
874+
return lastIndex !== -1 && lastIndex === originString.length - searchString.length;
871875
};
872876
}), angular.module("avUi").service("StateDataService", [ "$state", function($state) {
873877
var data = {};

dist/avWidgets.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
var link = links[i], href = link.getAttribute("href");
1010
void 0 !== callback && callback(link, i, className);
1111
var iframe = createElement("iframe", {
12-
"class": className + "-iframe",
12+
class: className + "-iframe",
1313
src: href,
1414
style: "border: 0; width: 100%; height: 100%",
1515
seamless: ""

0 commit comments

Comments
 (0)