Merge pull request #14199 from surajshetty3416/fix-login-issues

This commit is contained in:
Suraj Shetty 2021-09-14 20:01:20 +05:30 committed by GitHub
commit ef44f56b93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 41 additions and 16 deletions

View file

@ -1,7 +1,6 @@
context('Navigation', () => {
before(() => {
cy.login();
cy.visit('/app/website');
});
it('Navigate to route with hash in document name', () => {
cy.insert_doc('ToDo', {'__newname': 'ABC#123', 'description': 'Test this', 'ignore_duplicate': true});
@ -11,4 +10,15 @@ context('Navigation', () => {
cy.go('back');
cy.title().should('eq', 'Website');
});
it.only('Navigate to previous page after login', () => {
cy.visit('/app/todo');
cy.request('/api/method/logout');
cy.reload();
cy.get('.btn-primary').contains('Login').click();
cy.location('pathname').should('eq', '/login');
cy.login();
cy.visit('/app');
cy.location('pathname').should('eq', '/app/todo');
});
});

View file

@ -1,3 +1,7 @@
html, body {
height: 100%;
}
/* checkbox */
.checkbox {
label {

View file

@ -1,5 +1,4 @@
html {
height: 100%;
background-color: var(--bg-color);
}

View file

@ -1,9 +1,4 @@
html {
min-height: 100%;
}
body {
height: 100%;
// The html and body elements cannot have any padding or margin.
margin: 0px;
padding: 0px !important;

View file

@ -4,12 +4,17 @@ body {
background-color: var(--bg-light-gray);
}
.for-login,
.for-forgot,
.for-signup,
.for-email-login {
display: none;
margin: 70px 0;
}
.for-login,
.for-forgot,
.for-signup,
.for-email-login {
padding: max(15vh, 70px) 0;
@include media-breakpoint-up(sm) {
.page-card {

View file

@ -85,4 +85,15 @@
.form-control {
border: none;
font-size: var(--text-md);
}
.footer-logo-extension {
.input-group {
justify-content: flex-end;
#footer-subscribe-email, #footer-subscribe-button {
max-width: 300px;
border: 1px solid var(--dark-border-color);
box-shadow: none;
}
}
}

View file

@ -3,6 +3,7 @@
.web-form-wrapper {
.form-control {
color: var(--text-color);
background-color: var(--control-bg);
}
.form-section {

View file

@ -1,13 +1,13 @@
<div class="footer-logo-extension">
<div class="row">
<div class="text-left col-6">
<div class="text-left col-md-6">
{%- if footer_logo -%}
<div>
<img src="{{ footer_logo }}" alt="Footer Logo" class="footer-logo">
</div>
{%- endif -%}
</div>
<div class="text-right col-6">
<div class="text-right col-md-6">
{% block extension %}
{% include "templates/includes/footer/footer_extension.html" %}
{% endblock %}

View file

@ -154,11 +154,11 @@
</div>
</form>
{%- else -%}
<div class='page-card-head'>
<div class='page-card-head mb-2'>
<span class='indicator gray'>{{_("Signup Disabled")}}</span>
<p class="text-muted text-normal sign-up-message mt-1 mb-8">{{_("Signups have been disabled for this website.")}}</p>
<div><a href='/' class='btn btn-primary btn-md'>{{ _("Home") }}</a></div>
</div>
<p>{{_("Signups have been disabled for this website.")}}</p>
<div><a href='/' class='btn btn-primary btn-sm'>{{ _("Home") }}</a></div>
{%- endif -%}
</div>

View file

@ -39,8 +39,8 @@ html, body {
{% endif %}
<script>
frappe.ready(function() {
if(window.location.hash) {
localStorage.setItem('session_last_route', window.location.hash.substr(1));
if (window.location.hash || window.location.href.includes('/app')) {
localStorage.setItem('session_last_route', window.location.pathname + window.location.hash + window.location.search);
}
$('.btn-primary').focus();