-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backport] - FranceConnect Logout Modifications (#15)
* Update FC images * Update partials and views to make the button appear correctly everywhere * Normalize locales and add missing ones from FranceConnect * Update FranceConnect gem version * Extend this new file to disconnect from FC while deleting account from platform * Same but for the logout * Modify initializer of FranceConnect * Rubocop Changes
- Loading branch information
Showing
14 changed files
with
296 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<% add_decidim_page_title(t("devise.passwords.new.forgot_your_password")) %> | ||
|
||
<div class="wrapper"> | ||
<div class="row collapse"> | ||
<div class="row collapse"> | ||
<div class="columns large-8 large-centered text-center page-title"> | ||
<h1><%= t("devise.passwords.new.forgot_your_password") %></h1> | ||
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="columns medium-7 large-5 medium-centered"> | ||
<div class="card"> | ||
<div class="card__content"> | ||
<%= decidim_form_for(resource, namespace: "password", as: resource_name, url: password_path(resource_name), html: { method: :post, class: "register-form new_user" }) do |f| %> | ||
<div class="field"> | ||
<%= f.email_field :email, autofocus: true %> | ||
</div> | ||
|
||
<% if current_organization.enabled_omniauth_providers.keys.any? { |provider| provider.match?("france") } %> | ||
<div class="help-text ok-text"> | ||
<p><%= t("decidim.omniauth.france_connect.forgot_password.ok_text") %></p> | ||
</div> | ||
<% end %> | ||
|
||
<div class="actions"> | ||
<%= f.submit t("devise.passwords.new.send_me_reset_password_instructions"), class: "button expanded" %> | ||
</div> | ||
|
||
<% end %> | ||
<%= render "decidim/devise/shared/links" %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<div class="reveal" id="loginModal" data-reveal role="dialog" aria-modal="true" aria-labelledby="loginModal-label"> | ||
<div class="reveal__header"> | ||
<h2 id="loginModal-label" class="reveal__title"><%= t(".please_sign_in") %></h2> | ||
<button class="close-button" data-close aria-label="<%= t(".close_modal") %>" | ||
type="button"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
<% if current_organization.sign_in_enabled? %> | ||
<div class="border-t-2 border-background"> | ||
<% cache current_organization do %> | ||
<%= render "decidim/devise/shared/omniauth_buttons" %> | ||
<% end %> | ||
</div> | ||
<div class="row"> | ||
<div class="columns medium-8 medium-centered"> | ||
<% | ||
path = if content_for(:redirect_after_login) | ||
session_path(:user, redirect_url: content_for(:redirect_after_login)) | ||
else | ||
session_path(:user) | ||
end | ||
%> | ||
<%= decidim_form_for(Decidim::User.new, namespace: "login", as: :user, url: path, html: { class: "register-form new_user" }) do |f| %> | ||
<div> | ||
<div class="field"> | ||
<%= f.email_field :email %> | ||
</div> | ||
<div class="field"> | ||
<%= f.password_field :password, autocomplete: "off" %> | ||
</div> | ||
</div> | ||
<div class="actions"> | ||
<%= f.submit t("devise.sessions.new.sign_in"), class: "button expanded" %> | ||
</div> | ||
<% end %> | ||
<% if current_organization.sign_up_enabled? %> | ||
<p class="text-center"> | ||
<%= link_to t(".sign_up"), decidim.new_user_registration_path, class: "sign-up-link" %> | ||
</p> | ||
<% end %> | ||
<p class="text-center"> | ||
<%= link_to t("devise.shared.links.forgot_your_password"), new_password_path(:user) %> | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<% else %> | ||
<div class="row"> | ||
<div class="columns medium-8 medium-centered"> | ||
<p> | ||
<%= t("sign_in_disabled", scope: "decidim.devise.sessions.new") %> | ||
</p> | ||
</div> | ||
</div> | ||
<% cache current_organization do %> | ||
<%= render "decidim/devise/shared/omniauth_buttons" %> | ||
<% end %> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
if Rails.application.secrets.dig(:omniauth, :france_connect).present? | ||
Rails.application.config.middleware.use OmniAuth::Builder do | ||
provider( | ||
:france_connect, | ||
setup: lambda { |env| | ||
request = Rack::Request.new(env) | ||
organization = Decidim::Organization.find_by(host: request.host) | ||
provider_config = organization.enabled_omniauth_providers[:france_connect] | ||
env["omniauth.strategy"].options[:client_id] = provider_config[:client_id] | ||
env["omniauth.strategy"].options[:client_secret] = provider_config[:client_secret] | ||
env["omniauth.strategy"].options[:site] = provider_config[:site_url] | ||
env["omniauth.strategy"].options[:scope] = provider_config[:scope]&.split(" ") | ||
} | ||
) | ||
end | ||
Rails.application.config.middleware.use OmniAuth::Builder do | ||
provider( | ||
:france_connect, | ||
setup: lambda { |env| | ||
request = Rack::Request.new(env) | ||
organization = env["decidim.current_organization"].presence || Decidim::Organization.find_by(host: request.host) | ||
provider_config = organization.enabled_omniauth_providers[:france_connect] | ||
env["omniauth.strategy"].options[:client_id] = provider_config[:client_id] | ||
env["omniauth.strategy"].options[:client_secret] = provider_config[:client_secret] | ||
env["omniauth.strategy"].options[:site] = provider_config[:site_url] | ||
env["omniauth.strategy"].options[:scope] = provider_config[:scope]&.split(" ") | ||
} | ||
) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.