Commit: fc1c363648eafff95453b840c6d36ba5d983fa46
Author: Jon Adams | Date: 2010-01-31 23:19:45 -0800
diff --git a/config/bootstrap.php b/config/bootstrap.php
index 2f52330..bc4eac4 100644
--- a/config/bootstrap.php
+++ b/config/bootstrap.php
@@ -19,16 +19,6 @@ Session::config(array(
));
/**
- * Configure Shopify `Connection` with API credentials and desired `session_name`.
- */
-Connections::add('shopify', 'http', array(
- 'adapter' => '\li3_shopify\extensions\adapter\Shopify',
- 'api_key' => '',
- 'api_secret' => '',
- 'session_name' => 'shopify'
-));
-
-/**
* Upon user authentication, Shopify passes the user back to your app with the `shop` and `t`
* keys present in the url params. This filter checks for these vars and if present,
* passes them to the applicable shopify api connection (default `shopify`) methods to save this
@@ -47,7 +37,7 @@ Dispatcher::applyFilter('run', function($self, $params, $chain) {
extract($params);
$request = new \lithium\action\Request();
- $name = Connections::get('shopify')->config('session_name');
+ $name = 'shopify';
if (!empty($request->query)) {
if (isset($request->query['shop']) && !empty($request->query['shop'])) {
@@ -63,6 +53,16 @@ Dispatcher::applyFilter('run', function($self, $params, $chain) {
Session::read('token', compact('name'))
);
+ /**
+ * Configure Shopify `Connection` with API credentials and desired `session_name`.
+ */
+ Connections::add('shopify', 'http', array(
+ 'adapter' => '\li3_shopify\extensions\adapter\Shopify',
+ 'api_key' => '',
+ 'api_secret' => '',
+ 'session_name' => $name
+ ));
+
if (!$authenticated) {
if ($request->params = Router::parse($request)) {
if ($request->params['controller'] == 'shopify') {