Module: SessionsHelper
- Includes:
- Gitlab::Utils::StrongMemoize
- Included in:
- ApplicationController, Gitlab::BaseDoorkeeperController
- Defined in:
- app/helpers/sessions_helper.rb
Instance Method Summary collapse
- #obfuscated_email(email) ⇒ Object
- #remember_me_enabled? ⇒ Boolean
- #unconfirmed_email? ⇒ Boolean
- #unconfirmed_verification_email?(user) ⇒ Boolean
- #verification_data(user) ⇒ Object
- #verification_email(user) ⇒ Object
Instance Method Details
#obfuscated_email(email) ⇒ Object
10 11 12 13 |
# File 'app/helpers/sessions_helper.rb', line 10 def (email) # Moved to Gitlab::Utils::Email in 15.9 Gitlab::Utils::Email.(email) end |
#remember_me_enabled? ⇒ Boolean
15 16 17 |
# File 'app/helpers/sessions_helper.rb', line 15 def remember_me_enabled? Gitlab::CurrentSettings.remember_me_enabled? end |
#unconfirmed_email? ⇒ Boolean
6 7 8 |
# File 'app/helpers/sessions_helper.rb', line 6 def unconfirmed_email? flash[:alert] == t(:unconfirmed, scope: [:devise, :failure]) end |
#unconfirmed_verification_email?(user) ⇒ Boolean
19 20 21 22 |
# File 'app/helpers/sessions_helper.rb', line 19 def unconfirmed_verification_email?(user) token_valid_from = ::Users::EmailVerification::ValidateTokenService::TOKEN_VALID_FOR_MINUTES.minutes.ago user.email_reset_offered_at.nil? && user.pending_reconfirmation? && user.confirmation_sent_at >= token_valid_from end |
#verification_data(user) ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'app/helpers/sessions_helper.rb', line 28 def verification_data(user) { username: user.username, obfuscated_email: (verification_email(user)), verify_path: session_path(:user), resend_path: users_resend_verification_code_path, offer_email_reset: user.email_reset_offered_at.nil?.to_s, update_email_path: users_update_email_path } end |
#verification_email(user) ⇒ Object
24 25 26 |
# File 'app/helpers/sessions_helper.rb', line 24 def verification_email(user) unconfirmed_verification_email?(user) ? user.unconfirmed_email : user.email end |