Add default OAuths (#259)

This commit is contained in:
Riccardo Graziosi
2024-01-22 14:45:48 +01:00
committed by GitHub
parent 0828c9c879
commit 653e139a9e
32 changed files with 512 additions and 213 deletions

View File

@@ -24,10 +24,6 @@ module App
ENV["MULTI_TENANCY"] == "true"
end
def email_confirmation?
ENV["EMAIL_CONFIRMATION"] == "true"
end
def posts_per_page
15
end

View File

@@ -81,12 +81,10 @@ Rails.application.configure do
}
end
if ENV['EMAIL_CONFIRMATION']
config.action_mailer.default_options = {
from: ENV.fetch("EMAIL_MAIL_FROM", "Astuto <notifications@astuto.io>"),
config.action_mailer.default_options = {
from: ENV.fetch("EMAIL_MAIL_FROM", "Astuto <notifications@astuto.io>"),
reply_to: ENV.fetch("EMAIL_MAIL_REPLY_TO", ENV.fetch("EMAIL_MAIL_FROM", "Astuto <notifications@astuto.io>"))
}
end
}
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).

View File

@@ -3,9 +3,6 @@
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
# Set up default environment variables
ENV["EMAIL_CONFIRMATION"] = "no"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# For Devise

View File

@@ -69,12 +69,13 @@ en:
page_title: 'Create your feedback space'
step1:
title: '1. Create user account'
email_auth: 'Register with email'
email_auth: 'Sign up with email'
step2:
title: '2. Create feedback space'
create_button: 'Create feedback space'
validations:
subdomain_already_taken: 'Sorry, this subdomain is not available'
subdomain_only_letters_and_numbers: 'Subdomain can only contain alphanumeric characters and hyphen'
step3:
title: "You're almost done!"
message: "Check your email %{email} to activate your new feedback space %{subdomain}!"
@@ -195,6 +196,7 @@ en:
authentication:
title: 'Authentication'
oauth_subtitle: 'OAuth providers'
default_oauth: 'Default OAuth provider'
copy_url: 'Copy URL'
test_page:
title: '%{name} OAuth test results'

View File

@@ -29,6 +29,7 @@ Rails.application.routes.draw do
resources :o_auths, only: [:index, :create, :update, :destroy]
get '/o_auths/:id/start', to: 'o_auths#start', as: :o_auth_start
get '/o_auths/:id/callback', to: 'o_auths#callback', as: :o_auth_callback
get '/o_auths/sign_in_from_oauth_token', to: 'o_auths#sign_in_from_oauth_token', as: :o_auth_sign_in_from_oauth_token
resources :posts, only: [:index, :create, :show, :update, :destroy] do
resource :follows, only: [:create, :destroy]