Infrastructure connection updates

This commit is contained in:
2020-03-04 19:52:28 -05:00
parent 51748d5783
commit aec5364f2e
14 changed files with 48 additions and 21 deletions
+3 -3
View File
@@ -16,7 +16,7 @@ class ApplicationController < ActionController::Base
private
def authenticate_employee!
if auth_token = params[:auth_token].presence
if auth_token = params[:auth_token].presence || request.headers['HTTP_AUTH_TOKEN'].presence
raise CanCan::AccessDenied unless employee = Employee.find_by_authentication_token(auth_token)
bypass_sign_in employee
else
@@ -125,9 +125,9 @@ private
end
alias json_notice js_notice
def show_404
def show_404(options = {})
respond_to do |format|
format.html { render 'dashboard/404', layout: true, status: 404}
format.html { render 'dashboard/404', options.reverse_merge(layout: true, status: 404)}
format.json { render json: {ok: false}, status: 404 }
end
end
+1 -2
View File
@@ -1,8 +1,7 @@
class SupplierController < Suppliers::ApplicationController
def home
if Rails.env.development?
binding.pry
redirecto_to "http://localhost:4202/supplier#{params[:other]}"
redirect_to "http://localhost:4202/supplier/#{params[:other]}"
else
render html: File.read(Rails.root.join('public/supplier/index.html'))
end
@@ -25,7 +25,6 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
end
def failure(env = {})
#binding.pry
show_404
show_404 alert: "There was a problem authorizing and identifier the user"
end
end
+6 -4
View File
@@ -26,16 +26,18 @@ class User
validates_uniqueness_of :email
before_save :ensure_authentication_token
has_many :error_logs
#has_many :error_logs
has_many :user_feedbacks
view :by_authentication_token, key: :authentication_token
view :by_email, key: :email
view :by_facebook, key: [:provider, :uid] #DEPRICATE on successful change to by_provider
view :by_provider, key: [:provider, :uid]
#view :by_facebook, key: [:provider, :uid] #DEPRICATE on successful change to by_provider
#view :by_provider, key: [:provider, :uid]
view :by_provider_and_uid, key: [:provider, :uid]
def self.find_for_oauth(auth_data, user)
user = database.view(self.by_provider(key: [auth_data.provider, auth_data.uid], limit: 1)).first
#user = database.view(self.by_provider(key: [auth_data.provider, auth_data.uid], limit: 1)).first
user = find_by_provider_and_uid(auth_data.provider, auth_data.uid)
user || create(
provider: auth_data.provider,
+3
View File
@@ -0,0 +1,3 @@
h1 QR Scan landing page
p |
You are
+3 -1
View File
@@ -11,4 +11,6 @@
'
= link_to 'contact', main_app.page_path('contact', locale: 'en')
.clearfix
.footer-bottom &copy; mozo.bar 2019
.footer-bottom
span &copy; mozo.bar
span= Date.today.year