Load OmniauthTenantSetup inside a lambda

This way we avoid loading the OmniauthTenantSetup in the initializer,
which could be problematic when switching to Zeitwerk.
This commit is contained in:
Javi Martín
2024-03-29 00:49:18 +01:00
parent 1cf529b134
commit 1af5c18bd7
2 changed files with 12 additions and 20 deletions

View File

@@ -1,27 +1,19 @@
module OmniauthTenantSetup
class << self
def twitter
->(env) do
oauth(env, secrets.twitter_key, secrets.twitter_secret)
end
def twitter(env)
oauth(env, secrets.twitter_key, secrets.twitter_secret)
end
def facebook
->(env) do
oauth2(env, secrets.facebook_key, secrets.facebook_secret)
end
def facebook(env)
oauth2(env, secrets.facebook_key, secrets.facebook_secret)
end
def google_oauth2
->(env) do
oauth2(env, secrets.google_oauth2_key, secrets.google_oauth2_secret)
end
def google_oauth2(env)
oauth2(env, secrets.google_oauth2_key, secrets.google_oauth2_secret)
end
def wordpress_oauth2
->(env) do
oauth2(env, secrets.wordpress_oauth2_key, secrets.wordpress_oauth2_secret)
end
def wordpress_oauth2(env)
oauth2(env, secrets.wordpress_oauth2_key, secrets.wordpress_oauth2_secret)
end
private