-
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.
Add translations and skip first login if only center verification is …
…configured
- Loading branch information
Showing
6 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
...controllers/concerns/decidim/centers/devise/omniauth_registrations_controller_override.rb
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,21 @@ | ||
# frozen_string_literal: true | ||
|
||
require "active_support/concern" | ||
|
||
module Decidim | ||
module Centers | ||
module Devise | ||
module OmniauthRegistrationsControllerOverride | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
alias_method :original_first_login_and_not_authorized?, :first_login_and_not_authorized? | ||
|
||
def first_login_and_not_authorized?(user) | ||
original_first_login_and_not_authorized?(user) && Decidim::Verifications.workflows.any? { |manifest| manifest.name != "center" } | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
21 changes: 21 additions & 0 deletions
21
app/controllers/concerns/decidim/centers/devise/sessions_controller_override.rb
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,21 @@ | ||
# frozen_string_literal: true | ||
|
||
require "active_support/concern" | ||
|
||
module Decidim | ||
module Centers | ||
module Devise | ||
module SessionsControllerOverride | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
alias_method :original_first_login_and_not_authorized?, :first_login_and_not_authorized? | ||
|
||
def first_login_and_not_authorized?(user) | ||
original_first_login_and_not_authorized?(user) && current_organization.available_authorizations.excluding("center").any? | ||
end | ||
end | ||
end | ||
end | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ ignore_missing: | |
|
||
ignore_unused: | ||
- decidim.centers.admin_log.* | ||
- decidim.authorization_handlers.* |
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
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