connectycube
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -5,3 +5,3 @@ const config = require('./cubeConfig') | ||
class AuthService { | ||
constructor (proxy) { | ||
constructor(proxy) { | ||
this.proxy = proxy | ||
@@ -11,3 +11,7 @@ this.webSessionCheckInterval = null | ||
getSession () { | ||
setSession(session) { | ||
this.proxy.setSession(session) | ||
} | ||
getSession() { | ||
const ajaxParams = { | ||
@@ -30,3 +34,3 @@ type: 'GET', | ||
createSession (params) { | ||
createSession(params) { | ||
if (config.creds.appId === '' || | ||
@@ -67,3 +71,3 @@ config.creds.authKey === '' || | ||
destroySession () { | ||
destroySession() { | ||
const ajaxParams = { | ||
@@ -90,3 +94,3 @@ type: 'DELETE', | ||
createWebSession (params) { | ||
createWebSession(params) { | ||
if (!params) { | ||
@@ -101,3 +105,3 @@ params = { | ||
checkWebSessionUntilUpgrade (callback) { | ||
checkWebSessionUntilUpgrade(callback) { | ||
const interval = config.webSession.getSessionTimeInterval | ||
@@ -143,3 +147,3 @@ const timeoutError = new Error( | ||
upgradeWebSession (webToken) { | ||
upgradeWebSession(webToken) { | ||
const ajaxParams = { | ||
@@ -157,3 +161,3 @@ type: 'PATCH', | ||
login (params) { | ||
login(params) { | ||
const ajaxParams = { | ||
@@ -178,3 +182,3 @@ type: 'POST', | ||
logout () { | ||
logout() { | ||
const ajaxParams = { | ||
@@ -181,0 +185,0 @@ type: 'DELETE', |
@@ -149,3 +149,3 @@ const config = require('./cubeConfig') | ||
error.code === 401 && | ||
error.message.errors.base[0] === 'Required session does not exist' | ||
error.info.errors.base[0] === 'Required session does not exist' | ||
) | ||
@@ -152,0 +152,0 @@ } catch (ex) { |
@@ -67,2 +67,6 @@ const config = require('./cubeConfig') | ||
setSession(session) { | ||
this.auth.setSession(session) | ||
} | ||
getSession() { | ||
@@ -69,0 +73,0 @@ return this.auth.getSession() |
@@ -20,5 +20,6 @@ const config = require('./cubeConfig') | ||
this.sdkInstance.session = session | ||
// if (session && session.user_id) { | ||
// this.setCurrentUserId(session.user_id); | ||
// } | ||
if (session && session.user_id) { | ||
this.setCurrentUserId(session.user_id) | ||
} | ||
} | ||
@@ -214,3 +215,3 @@ | ||
code: (response && statusCode) || (error && error.code), | ||
info: (body && typeof body === 'string' ? JSON.parse(body) : body) || (error && error.errno), | ||
info: (body && typeof body === 'string' && body !== ' ' ? JSON.parse(body) : body) || (error && error.errno), | ||
} | ||
@@ -242,3 +243,3 @@ | ||
handleExpiredSessionResponse(error, response, reject, resolve, params) { | ||
const handleResponse = function () { | ||
const handleResponse = () => { | ||
if (error) { | ||
@@ -251,6 +252,8 @@ reject(error) | ||
const retryCallback = function (session) { | ||
const retryCallback = session => { | ||
if (session) { | ||
this.setSession(session) | ||
return this.ajax(params) | ||
this.ajax(params) | ||
.then(resolve) | ||
.catch(reject) | ||
} | ||
@@ -257,0 +260,0 @@ } |
{ | ||
"name": "connectycube", | ||
"description": "ConnectyCube chat and video chat JavaScript SDK", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"homepage": "https://developers.connectycube.com/reactnative", | ||
@@ -78,3 +78,3 @@ "main": "lib/cubeMain.js", | ||
}, | ||
"gitHead": "0377aca6153efdf3ddcc2957534b383d1d3665de" | ||
"gitHead": "b13a65b4834816c1a9a0d89933150e1b05ea7763" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1414023
9355