using authentication for app
This commit is contained in:
@@ -2,6 +2,15 @@ class UserController < ApplicationController
|
||||
before_filter :allow_mobile, :authenticate_user!
|
||||
layout 'phone'
|
||||
|
||||
def authenticate_user_wrapper!
|
||||
authenticate_user! unless request.format.html?
|
||||
authenticate_user! if params[:action] == 'obtain_token'
|
||||
end
|
||||
|
||||
def obtain_token
|
||||
|
||||
end
|
||||
|
||||
alias :list :active_list
|
||||
|
||||
def allow_mobile
|
||||
@@ -153,6 +162,7 @@ class UserController < ApplicationController
|
||||
redirect_to(root_path, alert: t('messages.there_is_no_list_active')) and return unless list.present?
|
||||
end
|
||||
format.json do
|
||||
render json: js_alert(t('messages.the_list_has_been_closed')) and return unless list.present?
|
||||
render json: list.with_orders_and_join_requests_as_json.merge(supplier_name: list.supplier.name)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user