Implement close window on server level
This commit is contained in:
@@ -12,6 +12,10 @@ class DashboardController < ApplicationController
|
||||
log.save
|
||||
end
|
||||
|
||||
def close_window
|
||||
render layout: false
|
||||
end
|
||||
|
||||
# Testing action
|
||||
def select_qrcode
|
||||
#@tables = Table.all.sample(2) | List.active.map(&:table)
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<script>localStorage.setItem('auth_token', '<%= params[:authentication_token] %>'); localStorage.setItem('user_id', '<%= params[:user_id] %>');window.close()</script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
@@ -71,6 +71,7 @@ Qwaiter::Application.routes.draw do
|
||||
post '/user/check_table_join_status' => 'user#check_table_join_status'
|
||||
get '/user/obtain_token' => 'user#obtain_token', as: :user_obtain_token
|
||||
post '/user/obtain_token' => 'user#obtain_token', constraints: {format: :json}
|
||||
get '/close_window' => 'dashboard#close_window'
|
||||
|
||||
namespace :users, path: '/user' do
|
||||
resources :product_categories, only: [:index]
|
||||
|
||||
@@ -7,7 +7,7 @@ step "There is no user information stored in the local storage" do
|
||||
end
|
||||
|
||||
step "I visit the user obtain token path" do
|
||||
visit user_obtain_token_path
|
||||
visit user_root_path # obtain token through ember application
|
||||
end
|
||||
|
||||
step "I am signed in as a user" do
|
||||
|
||||
Reference in New Issue
Block a user