-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix PWA for organizations with forced sign-in
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
app/controllers/concerns/decidim/force_authentication_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,19 @@ | ||
# frozen_string_literal: true | ||
|
||
module Decidim | ||
# Shared behaviour for force_users_to_authenticate_before_access_organization | ||
module ForceAuthenticationOverride | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
private | ||
|
||
def unauthorized_paths | ||
%w(/locale /manifest.webmanifest) + Decidim::StaticPage.where( | ||
organization: current_organization, | ||
allow_public_access: true | ||
).pluck(Arel.sql("CONCAT('/pages/', slug)")) | ||
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
Rails.application.config.to_prepare do | ||
Decidim::ForceAuthentication.prepend(Decidim::ForceAuthenticationOverride) | ||
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