Skip to content
Snippets Groups Projects
Commit 03b667e6 authored by Mauricio Giacomini Girardello's avatar Mauricio Giacomini Girardello
Browse files

Merge branch 'railsapi' of gitlab.c3sl.ufpr.br:portalmec/portalmec into railsapi

parents 5d25d09d 1da325ea
No related branches found
No related tags found
No related merge requests found
......@@ -92,9 +92,6 @@ gem 'font-awesome-rails'
group :development do
gem 'immigrant'
# mute assets in log
gem 'quiet_assets'
# static analysis tool for security vulnerabilities
gem 'brakeman', require: false
......@@ -178,3 +175,6 @@ gem 'mimemagic'
gem 'screencap'
gem 'wicked'
# using while rails 5 isn't released
gem 'rails-api'
class ApplicationController < ActionController::Base
class ApplicationController < ActionController::API
include Pundit
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :null_session
# protect_from_forgery with: :null_session
before_action :count_learning_objects
before_action :configure_permitted_parameters, if: :devise_controller?
......
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# require 'rails/all'
require 'active_record/railtie'
require 'action_controller/railtie'
require 'action_mailer/railtie'
# require 'action_view/railtie'
# require 'sprockets/railtie'
require 'rails/test_unit/railtie'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
......@@ -53,5 +59,8 @@ module Portalmec
# active job
config.active_job.queue_adapter = :sidekiq
# api mode
config.api_only = true
end
end
......@@ -228,6 +228,11 @@ Devise.setup do |config|
#
# The "*/*" below is required to match Internet Explorer requests.
# config.navigational_formats = ['*/*', :html]
#
# If using rails-api, you may want to tell devise to not use ActionDispatch::Flash
# middleware b/c rails-api does not include it.
# See: http://stackoverflow.com/q/19600905/806956
config.navigational_formats = [:json]
# The default HTTP method used to sign out a resource. Default is :delete.
config.sign_out_via = :delete
......@@ -236,9 +241,9 @@ Devise.setup do |config|
# Add a new OmniAuth provider. Check the wiki for more information on setting
# up on your models and hooks.
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
config.omniauth :facebook, "745857965514514", "eb465ec961022087f56204e3b86a63ee"
config.omniauth :twitter, "pGD4B2uPuDv07yYqshlwDmdeM", "zt2PHrfIhHjk8lRCqlc47BanKrBghjxYyh8XOzaSnPF27rTnNS"
config.omniauth :google_oauth2, "314037571286-v3in875omm5vn56uhg77j06vtuic223f.apps.googleusercontent.com", "cJN0MTZisPqkkCLg3kSQDWIx", { }
# config.omniauth :facebook, "745857965514514", "eb465ec961022087f56204e3b86a63ee"
# config.omniauth :twitter, "pGD4B2uPuDv07yYqshlwDmdeM", "zt2PHrfIhHjk8lRCqlc47BanKrBghjxYyh8XOzaSnPF27rTnNS"
# config.omniauth :google_oauth2, "314037571286-v3in875omm5vn56uhg77j06vtuic223f.apps.googleusercontent.com", "cJN0MTZisPqkkCLg3kSQDWIx", { }
# ==> Warden configuration
# If you want to use other strategies, that are not supported by Devise, or
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment