diff --git a/Changelog.md b/Changelog.md index 23a13145a..57b4966e4 100644 --- a/Changelog.md +++ b/Changelog.md @@ -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) diff --git a/app/assets/stylesheets/markdown-content.scss b/app/assets/stylesheets/markdown-content.scss index 6b092dbdb..c5813de21 100644 --- a/app/assets/stylesheets/markdown-content.scss +++ b/app/assets/stylesheets/markdown-content.scss @@ -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; } diff --git a/app/assets/stylesheets/registration.scss b/app/assets/stylesheets/registration.scss index 5fb2a2bc6..6fd755464 100644 --- a/app/assets/stylesheets/registration.scss +++ b/app/assets/stylesheets/registration.scss @@ -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 { diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 9d483a0cc..e679c85a4 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -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 diff --git a/app/models/user.rb b/app/models/user.rb index 8d30efa97..8ab4f9be6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -591,6 +591,10 @@ class User < ApplicationRecord end end + def remember_me + true + end + private def clearable_fields diff --git a/app/views/devise/passwords/edit.haml b/app/views/devise/passwords/edit.haml index 126ae62f4..28e2126ea 100644 --- a/app/views/devise/passwords/edit.haml +++ b/app/views/devise/passwords/edit.haml @@ -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 diff --git a/app/views/sessions/_form.haml b/app/views/sessions/_form.haml index ba56cbf04..a4e608386 100644 --- a/app/views/sessions/_form.haml +++ b/app/views/sessions/_form.haml @@ -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" diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 327cef80e..5cb23cc6d 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -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.