Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
edulix committed Nov 13, 2023
1 parent 7229b3b commit adb8a84
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
3 changes: 1 addition & 2 deletions avRegistration/login-directive/login-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ angular.module('avRegistration')
Authmethod,
StateDataService,
$state,
$stateParams,
$location,
$cookies,
$i18next,
Expand Down Expand Up @@ -720,7 +719,7 @@ angular.module('avRegistration')
var codename = response.data.error_codename;

setError(
"codename",
codename,
$i18next(
'avRegistration.loginError.' + scope.method + '.' + codename,
{support: '<a href="mailto:' + ConfigService.contact.email + '" target="_blank">' + ConfigService.contact.email + "</a>"}
Expand Down
4 changes: 2 additions & 2 deletions dist/appCommon-v10.0.2.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ angular.module("avRegistration").config(function() {}), angular.module("avRegist
$scope.withCode = $stateParams.withCode, $scope.withAltMethod = $stateParams.withAltMethod,
$scope.selectedAltMethod = $stateParams.altmethod, $scope.isOtl = $stateParams.isOtl,
$scope.otlSecret = $stateParams.otlSecret;
} ]), angular.module("avRegistration").directive("avLogin", [ "Authmethod", "StateDataService", "$state", "$stateParams", "$location", "$cookies", "$i18next", "$window", "$timeout", "ConfigService", "Patterns", function(Authmethod, StateDataService, $state, $stateParams, $location, $cookies, $i18next, $window, $timeout, ConfigService, Patterns) {
} ]), angular.module("avRegistration").directive("avLogin", [ "Authmethod", "StateDataService", "$state", "$location", "$cookies", "$i18next", "$window", "$timeout", "ConfigService", "Patterns", function(Authmethod, StateDataService, $state, $location, $cookies, $i18next, $window, $timeout, ConfigService, Patterns) {
return {
restrict: "AE",
scope: !0,
Expand Down Expand Up @@ -629,7 +629,7 @@ angular.module("avRegistration").config(function() {}), angular.module("avRegist
}, function(codename) {
scope.sendingData = !1;
codename = codename.data.error_codename;
setError("codename", $i18next("avRegistration.loginError." + scope.method + "." + codename, {
setError(codename, $i18next("avRegistration.loginError." + scope.method + "." + codename, {
support: '<a href="mailto:' + ConfigService.contact.email + '" target="_blank">' + ConfigService.contact.email + "</a>"
}));
});
Expand Down
15 changes: 15 additions & 0 deletions dist/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,21 @@
"CANT_AUTHENTICATE_TO_PARENT": "You are trying to authenticate to the wrong election. Please authenticate the parent election.<p>If you think this is an error, please contact support at __support__.</p>",
"INVALID_USER_CREDENTIALS": "<strong>Invalid User Credentials</strong>.There are multiple reasons why this can happen:<ul><li>Your email or authentication code are invalid.</li><li>Some other authentication credentials are invalid.</li><li>You are not part of the census.</li></ul><p>Please review your credentials and try again.<p>If you think this is an error, please contact support at __support__.</p>"
},
"openid-connect": {
"invalidCsrf": "There was an error during authentication: <strong>Invalid CSRF Token</strong>.<p>Please try again later. If the problem persists, please contact support at __support__.</p>",
"unexpectedOIDCRedirect": "There was an error during authentication: <strong>Unexpected OpenID Redirect</strong>.<p>Please try again later. If the problem persists, please contact support at __support__.</p>",
"unrecognizedServerResponse": "There was an error during authentication: <strong>Unrecognized Server Response</strong>.<p>Please try again later. If the problem persists, please contact support at __support__.</p>",
"invalidServerResponse": "There was an error during authentication: <strong>Invalid Server Response</strong>.<p>Please try again later. If the problem persists, please contact support at __support__.</p>",
"INTERNAL_SERVER_ERROR": "There was an error during authentication: <strong>Internal Server Error</strong>.<p>Please try again later. If the problem persists, please contact support at __support__.</p>",
"BAD_REQUEST": "There was an error during authentication: <strong>Bad Request</strong>.<p>Please try again later. If the problem persists, please contact support at __support__.</p>",
"INVALID_REQUEST": "There was an error during authentication: <strong>Invalid Request</strong>.<p>Please try again later. If the problem persists, please contact support at __support__.</p>",
"GENERAL_ERROR": "There was an error during authentication: <strong>General Error</strong>.<p>Please try again later. If the problem persists, please contact support at __support__.</p>",
"AUTH_EVENT_NOT_FOUND": "The election in which you are trying to authenticate was not found.<p>Please review you have the correct link. If the problem persists, please contact support at __support__.</p>",
"AUTH_EVENT_NOT_STARTED": "The voting period of the election is not open. It might be temporarely paused, stopped or not yet opened.<p>Please review and try again later. If the problem persists, please contact support at __support__.</p>",
"CANT_VOTE_MORE_TIMES": "Your authentication was successful, but we have already recorded a vote from you and you can't vote more times.<p>If you think this is an error, please contact support at __support__.</p>",
"CANT_AUTHENTICATE_TO_PARENT": "You are trying to authenticate to the wrong election. Please authenticate the parent election.<p>If you think this is an error, please contact support at __support__.</p>",
"INVALID_USER_CREDENTIALS": "<strong>Invalid User Credentials</strong>.There are multiple reasons why this can happen:<ul><li>Your email or authentication code are invalid.</li><li>Some other authentication credentials are invalid.</li><li>You are not part of the census.</li></ul><p>Please review your credentials and try again.<p>If you think this is an error, please contact support at __support__.</p>"
},
"email-and-password": {
"unrecognizedServerResponse": "There was an error during authentication: <strong>Unrecognized Server Response</strong>.<p>Please try again later. If the problem persists, please contact support at __support__.</p>",
"invalidServerResponse": "There was an error during authentication: <strong>Invalid Server Response</strong>.<p>Please try again later. If the problem persists, please contact support at __support__.</p>",
Expand Down
15 changes: 15 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,21 @@
"CANT_AUTHENTICATE_TO_PARENT": "You are trying to authenticate to the wrong election. Please authenticate the parent election.<p>If you think this is an error, please contact support at __support__.</p>",
"INVALID_USER_CREDENTIALS": "<strong>Invalid User Credentials</strong>.There are multiple reasons why this can happen:<ul><li>Your email or authentication code are invalid.</li><li>Some other authentication credentials are invalid.</li><li>You are not part of the census.</li></ul><p>Please review your credentials and try again.<p>If you think this is an error, please contact support at __support__.</p>"
},
"openid-connect": {
"invalidCsrf": "There was an error during authentication: <strong>Invalid CSRF Token</strong>.<p>Please try again later. If the problem persists, please contact support at __support__.</p>",
"unexpectedOIDCRedirect": "There was an error during authentication: <strong>Unexpected OpenID Redirect</strong>.<p>Please try again later. If the problem persists, please contact support at __support__.</p>",
"unrecognizedServerResponse": "There was an error during authentication: <strong>Unrecognized Server Response</strong>.<p>Please try again later. If the problem persists, please contact support at __support__.</p>",
"invalidServerResponse": "There was an error during authentication: <strong>Invalid Server Response</strong>.<p>Please try again later. If the problem persists, please contact support at __support__.</p>",
"INTERNAL_SERVER_ERROR": "There was an error during authentication: <strong>Internal Server Error</strong>.<p>Please try again later. If the problem persists, please contact support at __support__.</p>",
"BAD_REQUEST": "There was an error during authentication: <strong>Bad Request</strong>.<p>Please try again later. If the problem persists, please contact support at __support__.</p>",
"INVALID_REQUEST": "There was an error during authentication: <strong>Invalid Request</strong>.<p>Please try again later. If the problem persists, please contact support at __support__.</p>",
"GENERAL_ERROR": "There was an error during authentication: <strong>General Error</strong>.<p>Please try again later. If the problem persists, please contact support at __support__.</p>",
"AUTH_EVENT_NOT_FOUND": "The election in which you are trying to authenticate was not found.<p>Please review you have the correct link. If the problem persists, please contact support at __support__.</p>",
"AUTH_EVENT_NOT_STARTED": "The voting period of the election is not open. It might be temporarely paused, stopped or not yet opened.<p>Please review and try again later. If the problem persists, please contact support at __support__.</p>",
"CANT_VOTE_MORE_TIMES": "Your authentication was successful, but we have already recorded a vote from you and you can't vote more times.<p>If you think this is an error, please contact support at __support__.</p>",
"CANT_AUTHENTICATE_TO_PARENT": "You are trying to authenticate to the wrong election. Please authenticate the parent election.<p>If you think this is an error, please contact support at __support__.</p>",
"INVALID_USER_CREDENTIALS": "<strong>Invalid User Credentials</strong>.There are multiple reasons why this can happen:<ul><li>Your email or authentication code are invalid.</li><li>Some other authentication credentials are invalid.</li><li>You are not part of the census.</li></ul><p>Please review your credentials and try again.<p>If you think this is an error, please contact support at __support__.</p>"
},
"email-and-password": {
"unrecognizedServerResponse": "There was an error during authentication: <strong>Unrecognized Server Response</strong>.<p>Please try again later. If the problem persists, please contact support at __support__.</p>",
"invalidServerResponse": "There was an error during authentication: <strong>Invalid Server Response</strong>.<p>Please try again later. If the problem persists, please contact support at __support__.</p>",
Expand Down

0 comments on commit adb8a84

Please sign in to comment.