1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-21 15:54:22 +01:00

Updated Omniauth & Omniauth-oauth2 + fixed oauth2 callback url

This commit is contained in:
Sylvain 2019-10-02 16:06:27 +02:00
parent 927479733b
commit 5fcf9968cb
6 changed files with 49 additions and 23 deletions

View File

@ -69,9 +69,9 @@ gem 'seed_dump'
gem 'pg' gem 'pg'
gem 'devise', ">= 4.6.0" gem 'devise', '>= 4.6.0'
gem 'omniauth', '~> 1.6.0' gem 'omniauth', '~> 1.9.0'
gem 'omniauth-oauth2' gem 'omniauth-oauth2'
gem 'omniauth-rails_csrf_protection', '~> 0.1' gem 'omniauth-rails_csrf_protection', '~> 0.1'

View File

@ -159,7 +159,7 @@ GEM
execjs (2.7.0) execjs (2.7.0)
faker (1.4.3) faker (1.4.3)
i18n (~> 0.5) i18n (~> 0.5)
faraday (0.9.2) faraday (0.16.2)
multipart-post (>= 1.2, < 3) multipart-post (>= 1.2, < 3)
ffi (1.9.24) ffi (1.9.24)
figaro (1.1.0) figaro (1.1.0)
@ -180,7 +180,7 @@ GEM
activerecord (>= 3.0) activerecord (>= 3.0)
hashdiff (0.3.0) hashdiff (0.3.0)
hashery (2.1.2) hashery (2.1.2)
hashie (3.5.7) hashie (3.6.0)
hike (1.2.3) hike (1.2.3)
htmlentities (4.3.4) htmlentities (4.3.4)
http (3.0.0) http (3.0.0)
@ -209,7 +209,7 @@ GEM
railties (>= 4.2.0) railties (>= 4.2.0)
thor (>= 0.14, < 2.0) thor (>= 0.14, < 2.0)
json (1.8.6) json (1.8.6)
jwt (1.5.1) jwt (2.2.1)
kaminari (0.16.3) kaminari (0.16.3)
actionpack (>= 3.0.0) actionpack (>= 3.0.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
@ -243,8 +243,8 @@ GEM
minitest (>= 5.0) minitest (>= 5.0)
ruby-progressbar ruby-progressbar
multi_json (1.13.1) multi_json (1.13.1)
multi_xml (0.5.5) multi_xml (0.6.0)
multipart-post (2.0.0) multipart-post (2.1.1)
naught (1.1.0) naught (1.1.0)
nokogiri (1.10.4) nokogiri (1.10.4)
mini_portile2 (~> 2.4.0) mini_portile2 (~> 2.4.0)
@ -252,19 +252,19 @@ GEM
jbuilder (~> 2.0) jbuilder (~> 2.0)
rails (>= 4.2.0) rails (>= 4.2.0)
responders (~> 2.0) responders (~> 2.0)
oauth2 (1.0.0) oauth2 (1.4.2)
faraday (>= 0.8, < 0.10) faraday (>= 0.8, < 2.0)
jwt (~> 1.0) jwt (>= 1.0, < 3.0)
multi_json (~> 1.3) multi_json (~> 1.3)
multi_xml (~> 0.5) multi_xml (~> 0.5)
rack (~> 1.2) rack (>= 1.2, < 3)
oj (2.12.8) oj (2.12.8)
omniauth (1.6.1) omniauth (1.9.0)
hashie (>= 3.4.6, < 3.6.0) hashie (>= 3.4.6, < 3.7.0)
rack (>= 1.6.2, < 3) rack (>= 1.6.2, < 3)
omniauth-oauth2 (1.3.1) omniauth-oauth2 (1.6.0)
oauth2 (~> 1.0) oauth2 (~> 1.1)
omniauth (~> 1.2) omniauth (~> 1.9)
omniauth-rails_csrf_protection (0.1.2) omniauth-rails_csrf_protection (0.1.2)
actionpack (>= 4.2) actionpack (>= 4.2)
omniauth (>= 1.3.1) omniauth (>= 1.3.1)
@ -513,7 +513,7 @@ DEPENDENCIES
minitest-reporters minitest-reporters
notify_with notify_with
oj oj
omniauth (~> 1.6.0) omniauth (~> 1.9.0)
omniauth-oauth2 omniauth-oauth2
omniauth-rails_csrf_protection (~> 0.1) omniauth-rails_csrf_protection (~> 0.1)
openlab_ruby openlab_ruby

View File

@ -1,3 +1,6 @@
# frozen_string_literal: true
# RSS feed about 10 last events
class Rss::EventsController < Rss::RssController class Rss::EventsController < Rss::RssController
def index def index

View File

@ -1,16 +1,21 @@
# Add application configuration variables here, as shown below. # Add application configuration variables here, as shown below.
# Databases
POSTGRES_HOST: localhost POSTGRES_HOST: localhost
POSTGRES_PASSWORD: POSTGRES_PASSWORD:
REDIS_HOST: localhost REDIS_HOST: localhost
ELASTICSEARCH_HOST: localhost ELASTICSEARCH_HOST: localhost
# Stripe
SECRET_KEY_BASE: 83daf5e7b80d990f037407bab78dff9904aaf3c195a50f84fa8695a22287e707dfbd9524b403b1dcf116ae1d8c06844c3d7ed942564e5b46be6ae3ead93a9d30 SECRET_KEY_BASE: 83daf5e7b80d990f037407bab78dff9904aaf3c195a50f84fa8695a22287e707dfbd9524b403b1dcf116ae1d8c06844c3d7ed942564e5b46be6ae3ead93a9d30
STRIPE_API_KEY: STRIPE_API_KEY:
STRIPE_PUBLISHABLE_KEY: STRIPE_PUBLISHABLE_KEY:
STRIPE_CURRENCY: 'eur' STRIPE_CURRENCY: 'eur'
# Invoices
INVOICE_PREFIX: Demo-FabLab-facture INVOICE_PREFIX: Demo-FabLab-facture
# FabLab optional modules
FABLAB_WITHOUT_PLANS: 'false' FABLAB_WITHOUT_PLANS: 'false'
FABLAB_WITHOUT_SPACES: 'true' FABLAB_WITHOUT_SPACES: 'true'
FABLAB_WITHOUT_ONLINE_PAYMENT: 'false' FABLAB_WITHOUT_ONLINE_PAYMENT: 'false'
@ -18,9 +23,11 @@ FABLAB_WITHOUT_INVOICES: 'false'
DEFAULT_MAIL_FROM: Fab Manager Demo <noreply@fab-manager.com> DEFAULT_MAIL_FROM: Fab Manager Demo <noreply@fab-manager.com>
# For prod & staging env only # Configure carefully!
DEFAULT_HOST: 'localhost:5000' DEFAULT_HOST: 'localhost:5000'
DEFAULT_PROTOCOL: http DEFAULT_PROTOCOL: http
# Email config
DELIVERY_METHOD: smtp DELIVERY_METHOD: smtp
SMTP_ADDRESS: SMTP_ADDRESS:
SMTP_PORT: '587' SMTP_PORT: '587'
@ -29,21 +36,28 @@ SMTP_PASSWORD:
SMTP_AUTHENTICATION: 'plain' SMTP_AUTHENTICATION: 'plain'
SMTP_ENABLE_STARTTLS_AUTO: 'true' SMTP_ENABLE_STARTTLS_AUTO: 'true'
SMTP_OPENSSL_VERIFY_MODE: '' SMTP_OPENSSL_VERIFY_MODE: ''
# Google analytics
GA_ID: '' GA_ID: ''
# Google recaptcha
RECAPTCHA_SITE_KEY: '' RECAPTCHA_SITE_KEY: ''
RECAPTCHA_SECRET_KEY: '' RECAPTCHA_SECRET_KEY: ''
##
# Projects comments
DISQUS_SHORTNAME: DISQUS_SHORTNAME:
# Twitter sharing & last tweet on home page
TWITTER_NAME: 'FablabGrenoble' TWITTER_NAME: 'FablabGrenoble'
TWITTER_CONSUMER_KEY: '' TWITTER_CONSUMER_KEY: ''
TWITTER_CONSUMER_SECRET: '' TWITTER_CONSUMER_SECRET: ''
TWITTER_ACCESS_TOKEN: '' TWITTER_ACCESS_TOKEN: ''
TWITTER_ACCESS_TOKEN_SECRET: '' TWITTER_ACCESS_TOKEN_SECRET: ''
# Facebook sharing
FACEBOOK_APP_ID: '' FACEBOOK_APP_ID: ''
# I18N configuration
RAILS_LOCALE: 'fr' RAILS_LOCALE: 'fr'
APP_LOCALE: 'fr' APP_LOCALE: 'fr'
MOMENT_LOCALE: 'fr' MOMENT_LOCALE: 'fr'
@ -60,10 +74,13 @@ D3_DATE_FORMAT: '%d/%m/%y'
UIB_DATE_FORMAT: 'dd/MM/yyyy' UIB_DATE_FORMAT: 'dd/MM/yyyy'
EXCEL_DATE_FORMAT: 'dd/mm/yyyy' EXCEL_DATE_FORMAT: 'dd/mm/yyyy'
# OpenProjects
OPENLAB_APP_SECRET: OPENLAB_APP_SECRET:
OPENLAB_APP_ID: OPENLAB_APP_ID:
# do not change this URL
OPENLAB_BASE_URI: 'https://openprojects.fab-manager.com' OPENLAB_BASE_URI: 'https://openprojects.fab-manager.com'
# System settings
LOG_LEVEL: 'debug' LOG_LEVEL: 'debug'
DISK_SPACE_MB_ALERT: '100' DISK_SPACE_MB_ALERT: '100'
SUPERADMIN_EMAIL: 'admin@sleede.com' SUPERADMIN_EMAIL: 'admin@sleede.com'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Use this hook to configure devise mailer, warden hooks and so forth. # Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model. # Many of these configuration options can be set straight in your model.
Devise.setup do |config| Devise.setup do |config|

View File

@ -24,6 +24,10 @@ module OmniAuth::Strategies
authorize_url: active_provider.providable.authorization_endpoint, authorize_url: active_provider.providable.authorization_endpoint,
token_url: active_provider.providable.token_endpoint token_url: active_provider.providable.token_endpoint
def callback_url
url = Rails.application.config.action_controller.default_url_options
"#{url[:protocol]}://#{url[:host]}#{script_name}#{callback_path}"
end
uid { parsed_info['user.uid'.to_sym] } uid { parsed_info['user.uid'.to_sym] }