Skip to content

Commit e93c0f5

Browse files
committed
Fix sms verification revocation task
Refs #580 Workaround for decidim/decidim#16546
1 parent f309605 commit e93c0f5

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

lib/tasks/sms.rake

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Adds a missing rake task for revoking SMS verifications.
2+
# Decidim is supposed to add this task in decidim-verifications/lib/tasks/revoke.rake
3+
# But this file is evaluated before the initializers have a chance to configure the
4+
# Decidim.sms_gateway_service (in our decidim initializer) and register the sms
5+
# verification workflow (in decidim-verifications/lib/decidim/verifications/sms/engine.rb)
6+
#
7+
# See https://github.com/decidim/decidim/issues/16546 where this bug is reported and tracked.
8+
9+
namespace :decidim do
10+
namespace :verifications do
11+
namespace :revoke do
12+
desc "Revokes authorizations for the sms workflow"
13+
task :sms, [] => :environment do
14+
logger.info("=== Revoking authorizations for the sms workflow")
15+
Decidim::Authorization.where(name: :sms).destroy_all
16+
logger.info("===== Done")
17+
end
18+
end
19+
end
20+
end

0 commit comments

Comments
 (0)