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! #unless Rails.env.test?
|
||||
|
||||
|
||||
private
|
||||
|
||||
def authenticate_user_from_token!
|
||||
user_token = params[:user_token].presence
|
||||
user = user_token && User.find_by_authentication_token(user_token.to_s)
|
||||
user_email = params[:user_email].presence
|
||||
user = user_email && User.find_by_email(user_email)
|
||||
|
||||
if user
|
||||
sign_in user, store: false
|
||||
if user && Devise.secure_compare(user.authentication_token, params[:user_token])
|
||||
sign_in user, store:false
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
@ -11,6 +11,6 @@ FactoryGirl.define do
|
||||
keywords "MyString"
|
||||
focus "MyString"
|
||||
notes "MyString"
|
||||
asseturls ["MyString", "MyString2"]
|
||||
asseturls "MyString, MyString2"
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user