From b8abc01cdb46da3f52841fef95ef67d1d4b82393 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Guhur Date: Sat, 18 Apr 2020 16:27:15 +0000 Subject: [PATCH] close election when tokens are added --- src/components/views/CreateElection.jsx | 2 +- src/components/views/Vote.jsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/views/CreateElection.jsx b/src/components/views/CreateElection.jsx index f4f140f..b5047a8 100644 --- a/src/components/views/CreateElection.jsx +++ b/src/components/views/CreateElection.jsx @@ -561,7 +561,7 @@ class CreateElection extends Component {
{t( - "List voters' emails in case the election is not opened", + "If you list voters' emails, only them will be able to access the election", )}
diff --git a/src/components/views/Vote.jsx b/src/components/views/Vote.jsx index ad5bb3e..e34814b 100644 --- a/src/components/views/Vote.jsx +++ b/src/components/views/Vote.jsx @@ -132,6 +132,7 @@ class Vote extends Component { const { ratedCandidates } = this.state; const electionSlug = this.props.match.params.slug; + const token = this.props.location.search.substr(7); const endpoint = resolve( this.context.urlServer, this.context.routesServer.voteElection @@ -153,7 +154,8 @@ class Vote extends Component { headers: { "Content-Type": "application/json" }, body: JSON.stringify({ election: electionSlug, - grades_by_candidate: gradesByCandidate + grades_by_candidate: gradesByCandidate, + token: token, }) }) .then(this.handleErrors)