Module: Api::V5::Concerns::Authorization
- Included in:
- Api::V5::CreditCardsController, FavoriteRestaurantsController, HomesController, NotificationsController, PagesController, PendingTransactionsController, PhoneVerificationsController, PointsController, ReservationsController, RestaurantTagGroupsController, RestaurantsController, ReviewsController, TicketTransactionsController, TicketsController, UserAddressesController, UserIpLocationsController, UserRestaurantHistoriesController, Users::DevicesController, UsersController, VoucherTransactionsController, VouchersController
- Defined in:
- app/controllers/api/v5/concerns/authorization.rb
Overview
Authorization functionality
Facebook authorization no longer required because we use Facebook only for retrieve user data upon registration so for next authentication, all users are authorized by Doorkeeper system
Instance Method Summary collapse
Instance Method Details
#authorize ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'app/controllers/api/v5/concerns/authorization.rb', line 26 def return true if doorkeeper_token.nil? rescue ApiV5::Errors::AuthenticationError, ActionController::ParameterMissing, ApiV5::Errors::LineAuthenticationError nil end |
#authorize! ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/api/v5/concerns/authorization.rb', line 12 def line_id = if params.key?(:guest_user) params[:guest_user].key?(:line_id) && params[:guest_user][:line_id] else params[:line_id] end if line_id (line_id) else end end |
#current_user ⇒ Object
35 36 37 |
# File 'app/controllers/api/v5/concerns/authorization.rb', line 35 def current_user @current_user end |
#user_signed_in? ⇒ Boolean
39 40 41 |
# File 'app/controllers/api/v5/concerns/authorization.rb', line 39 def user_signed_in? defined?(@current_user) && @current_user end |