Merge pull request #11 from beatriceo/devise-fix

bugfix devise
This commit is contained in:
Ethan1710 2018-08-28 15:45:02 +01:00 committed by GitHub
commit 9f23553256
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -1,5 +1,5 @@
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
protect_from_forgery with: :exception protect_from_forgery with: :exception
before_action :authenticate_user! # before_action :authenticate_user!
protect_from_forgery unless: -> { request.format.json? } # Only accept json protect_from_forgery unless: -> { request.format.json? } # Only accept json
end end

View File

@ -1,5 +1,5 @@
class PagesController < ApplicationController class PagesController < ApplicationController
skip_before_action :authenticate_user!, only: [:call] # skip_before_action :authenticate_user!, only: [:call]
def call def call
end end

View File

@ -1,6 +1,9 @@
Rails.application.routes.draw do Rails.application.routes.draw do
get 'video_sessions/create' get 'video_sessions/create'
devise_for :users devise_for :users, path: '', path_names: { sign_out: 'logout'}
devise_scope :user do
get '/logout', to: 'devise/sessions#destroy'
end
root to: 'pages#home' root to: 'pages#home'
get '/contacts', to: 'users#index' get '/contacts', to: 'users#index'
post '/sessions', to: 'video_sessions#create' post '/sessions', to: 'video_sessions#create'