Skip to content

Commit

Permalink
Merge pull request #102 from fivejars/YGBWSLA-166
Browse files Browse the repository at this point in the history
[YGBWSLA-166] Fix recaptcha error in custom login
  • Loading branch information
anpolimus authored Sep 11, 2020
2 parents 4b7e126 + 6ba6eb4 commit e2995c9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion js/gated-content/dist/gated-content.umd.min.js

Large diffs are not rendered by default.

13 changes: 4 additions & 9 deletions js/gated-content/src/components/Pagination.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<nav class="text-center">
<span v-if="currentPage === 0 && itemsCount < pageLimit" class="d-none"></span>
<span v-if="hidePager" class="d-none"></span>
<ul class="pagination justify-content-center m-4" v-else>
<li class="page-item" :class="{ disabled: disablePrev }">
<span class="page-link" v-if="disablePrev">Prev</span>
Expand Down Expand Up @@ -41,14 +41,6 @@ export default {
links: {
type: Object,
},
itemsCount: {
type: Number,
default: 0,
},
pageLimit: {
type: Number,
default: 12,
},
},
computed: {
disablePrev() {
Expand All @@ -57,6 +49,9 @@ export default {
disableNext() {
return typeof this.links.next === 'undefined';
},
hidePager() {
return this.disablePrev && this.disableNext;
},
},
methods: {
paginateObject(pageTo) {
Expand Down
12 changes: 11 additions & 1 deletion js/gated-content/src/components/auth/CustomAuth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
<div class="container">
<div v-if="message" class="alert alert-info">
<span v-html="message"></span>
<a href="#" @click.prevent="resetForm">Back to Login form</a>
</div>
<div v-if="loading" class="spinner-center">
<Spinner></Spinner>
</div>
<form v-else class="plugin-custom">
<form v-show="!message && !loading" class="plugin-custom">
<div v-if="error" class="alert alert-danger">
<span>{{ error }}</span>
</div>
Expand Down Expand Up @@ -60,6 +61,15 @@ export default {
},
},
methods: {
resetForm() {
this.error = '';
this.message = '';
this.form.email = '';
this.loading = false;
if (this.config.enableRecaptcha && this.$refs.recaptcha) {
this.$refs.recaptcha.reset();
}
},
async login() {
this.loading = true;
this.error = '';
Expand Down
2 changes: 0 additions & 2 deletions js/gated-content/src/components/blog/BlogListing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
<Pagination
v-if="pagination"
:links="links"
:itemsCount="listing.length"
:pageLimit="parseInt(config.pager_limit, 10)"
></Pagination>
</div>
</template>
Expand Down
2 changes: 0 additions & 2 deletions js/gated-content/src/components/video/VideoListing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
<Pagination
v-if="pagination"
:links="links"
:itemsCount="listing.length"
:pageLimit="parseInt(config.pager_limit, 10)"
></Pagination>
</div>
</template>
Expand Down

0 comments on commit e2995c9

Please sign in to comment.