Fixed routes and paths

This commit is contained in:
2016-01-04 21:40:26 -05:00
parent 168c53b71b
commit 56e1c2c8a4
3 changed files with 6 additions and 6 deletions

View File

@@ -30,7 +30,7 @@ class QboController < ApplicationController
# Called when the user requests that Redmine to connect to QBO
#
def authenticate
callback = "https://rickbarrette.org/redmine/oauth_callback"
callback = request.base_url + qbo_oauth_callback_path
token = $qb_oauth_consumer.get_request_token(:oauth_callback => callback)
session[:qb_request_token] = token
redirect_to("https://appcenter.intuit.com/Connect/Begin?oauth_token=#{token.token}") and return
@@ -58,7 +58,7 @@ class QboController < ApplicationController
if qbo.save!
redirect_to plugin_settings_path(:redmine_qbo), :flash => { :notice => "Successfully connected to Quickbooks" }
else
redirect_to plugin_settings_path(:redmine_qbo), :flash => { :error => "Errorn_settings_path" }
redirect_to plugin_settings_path(:redmine_qbo), :flash => { :error => "Error" }
end
end

View File

@@ -55,4 +55,4 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
Note: You need to authenticate after saving your key and secret above
<br/>
<%= link_to "Authenticate", authenticate_path, :method => :get %>
<%= link_to "Authenticate", qbo_authenticate_path, :method => :get %>

View File

@@ -12,7 +12,7 @@
# See: http://guides.rubyonrails.org/routing.html
#
get 'authenticate', :to => 'qbo#authenticate'
get 'oauth_callback', :to => 'qbo#oauth_callback'
get 'qbo/authenticate', :to => 'qbo#authenticate'
get 'qbo/oauth_callback', :to => 'qbo#oauth_callback'
get 'qbo_sync', :to => 'qbo#sync'
get 'qop/qbo_sync', :to => 'qbo#sync'