Change videolistings to be not array until specified in the factory. Add email to authentication
This commit is contained in:
parent
4cdb417179
commit
91b451180a
@ -5,17 +5,15 @@ class ApplicationController < ActionController::Base
|
|||||||
before_action :authenticate_user_from_token!
|
before_action :authenticate_user_from_token!
|
||||||
before_action :authenticate_user! #unless Rails.env.test?
|
before_action :authenticate_user! #unless Rails.env.test?
|
||||||
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def authenticate_user_from_token!
|
def authenticate_user_from_token!
|
||||||
user_token = params[:user_token].presence
|
user_email = params[:user_email].presence
|
||||||
user = user_token && User.find_by_authentication_token(user_token.to_s)
|
user = user_email && User.find_by_email(user_email)
|
||||||
|
|
||||||
if user
|
if user && Devise.secure_compare(user.authentication_token, params[:user_token])
|
||||||
sign_in user, store: false
|
sign_in user, store:false
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,6 +11,6 @@ FactoryGirl.define do
|
|||||||
keywords "MyString"
|
keywords "MyString"
|
||||||
focus "MyString"
|
focus "MyString"
|
||||||
notes "MyString"
|
notes "MyString"
|
||||||
asseturls ["MyString", "MyString2"]
|
asseturls "MyString, MyString2"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user