From 3d442761057304f6ae7bef65e74f122750edf20d Mon Sep 17 00:00:00 2001 From: Ethan Fraenkel Date: Tue, 28 Aug 2018 15:46:15 +0200 Subject: [PATCH] bugfix devise --- app/controllers/application_controller.rb | 2 +- app/controllers/pages_controller.rb | 2 +- config/routes.rb | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 9264647..a0dedd0 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,5 +1,5 @@ class ApplicationController < ActionController::Base protect_from_forgery with: :exception - before_action :authenticate_user! + # before_action :authenticate_user! protect_from_forgery unless: -> { request.format.json? } # Only accept json end diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 698a3b7..21bafbc 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -1,5 +1,5 @@ class PagesController < ApplicationController - skip_before_action :authenticate_user!, only: [:call] + # skip_before_action :authenticate_user!, only: [:call] def call end diff --git a/config/routes.rb b/config/routes.rb index 5326d09..2f61ab5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,9 @@ Rails.application.routes.draw do 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' get '/contacts', to: 'users#index' post '/sessions', to: 'video_sessions#create'