Merge branch 'next-minor' into develop

This commit is contained in:
Benjamin Neff 2019-06-17 01:20:42 +02:00
commit 6f14f1b850
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
8 changed files with 48 additions and 20 deletions

View file

@ -13,12 +13,22 @@
* Add client-site rescaling of post images if they exceed the maximum possible size [#7734](https://github.com/diaspora/diaspora/pull/7734)
* Add backend for archive import [#7660](https://github.com/diaspora/diaspora/pull/7660)
# 0.7.12.0
# 0.7.13.0
## Refactor
## Bug fixes
## Features
# 0.7.12.0
## Refactor
* Harmonize markdown titles sizes [#8029](https://github.com/diaspora/diaspora/pull/8029)
## Bug fixes
* Improve handling of mixed case hostnames while fetching OpenGraph data [#8021](https://github.com/diaspora/diaspora/pull/8021)
* Fix "remember me" with two factor authentication enabled [#8031](https://github.com/diaspora/diaspora/pull/8031)
## Features
* Add line mentioning diaspora\* on the splash page [#7966](https://github.com/diaspora/diaspora/pull/7966)

View file

@ -16,6 +16,30 @@
}
}
h1 {
font-size: 2.7rem;
}
h2 {
font-size: 2.3rem;
}
h3 {
font-size: 2rem;
}
h4 {
font-size: 1.8rem;
}
h5 {
font-size: 1.6rem;
}
h6 {
font-size: 1.4rem;
}
.img-responsive {
display: inline;
}

View file

@ -38,16 +38,13 @@
width: 120px;
}
.captcha-input {
.form-control.captcha-input {
border-bottom: 1px solid $input-border;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
box-sizing: border-box;
font-size: 16px;
height: 40px;
line-height: $line-height-base;
padding: 10px 10px 10px 130px;
width: 100%;
padding-left: 130px;
}
.terms > a {

View file

@ -12,21 +12,21 @@ class SessionsController < Devise::SessionsController
# rubocop:enable Rails/LexicallyScopedActionFilter
def find_user
return User.find(session[:otp_user_id]) if session[:otp_user_id]
return User.find_for_authentication(username: params[:user][:username]) if params[:user][:username]
User.find_for_authentication(username: params[:user][:username]) if params[:user][:username]
User.find(session[:otp_user_id]) if session[:otp_user_id]
end
def authenticate_with_2fa
self.resource = find_user
u = find_user
return true unless u&.otp_required_for_login?
return true unless resource&.otp_required_for_login?
if params[:user][:otp_attempt].present? && session[:otp_user_id]
authenticate_with_two_factor_via_otp(u)
elsif u&.valid_password?(params[:user][:password])
prompt_for_two_factor(u)
authenticate_with_two_factor_via_otp(resource)
else
strategy = Warden::Strategies[:database_authenticatable].new(warden.env, :user)
prompt_for_two_factor(strategy.user) if strategy.valid? && strategy._run!.successful?
end
end

View file

@ -591,6 +591,10 @@ class User < ApplicationRecord
end
end
def remember_me
true
end
private
def clearable_fields

View file

@ -37,7 +37,6 @@
autocorrect: "off",
aria: {labelledby: "passwordConfirmationLabel"}
= hidden_field(:user, :remember_me, value: 1)
= f.submit t("devise.passwords.edit.change_password"), class: "btn btn-block btn-primary"
.text-center

View file

@ -40,5 +40,4 @@
autocorrect: "off",
aria: {labelledby: "passwordLabel"}
= f.hidden_field :remember_me, value: 1
= f.submit t("devise.sessions.new.sign_in"), class: "btn btn-large btn-block btn-primary"

View file

@ -15,11 +15,6 @@ end
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
config.warden do |manager|
manager.default_strategies(scope: :user).unshift :two_factor_authenticatable
manager.default_strategies(scope: :user).unshift :two_factor_backupable
end
# The secret key used by Devise. Devise uses this key to generate
# random tokens. Changing this key will render invalid all existing
# confirmation, reset password and unlock tokens in the database.