Skip to content

Commit 59ecbf1

Browse files
committed
fixed compute
1 parent 1e3df39 commit 59ecbf1

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

gbmapi/auth.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
class GBMAuth(GBMApiBase):
1414
API_URL = "https://auth.gbm.com"
15-
ORIGIN = 'https://app.gbm.com'
15+
ORIGIN = 'https://www.appgbm.com'
1616

1717
def __init__(self, user, password, secret, device, latitude, longitude, device_mac_address,
1818
client_id=CLIENT_ID):
@@ -50,6 +50,14 @@ def load_credentials(self):
5050

5151
return cred
5252

53+
def unload_credentials(self):
54+
cred = self.credentials
55+
if cred is None:
56+
pass
57+
else:
58+
self.logout(cred)
59+
# self.credentials = None
60+
5361
def access_token(self):
5462
cred = self.load_credentials()
5563
return cred['tokenType'] + ' ' + cred['accessToken']
@@ -145,13 +153,19 @@ def refresh(self):
145153
return resp
146154

147155
# After Authenticated
148-
def logout(self):
156+
def logout(self, cred):
149157
# Clear Session Token
150158
self._request(
151-
path=f"/api/v1/session/user?client_id={self.client_id}",
152-
method="DELETE"
159+
path=f"/api/v1/session/user/global",
160+
method="DELETE",
161+
json={
162+
"token": cred['accessToken']
163+
},
164+
headers={
165+
"authorization": cred['tokenType'] + ' ' + cred['accessToken']
166+
},
167+
authenticate=False
153168
)
154-
self.credentials = None
155169

156170
def security_settings(self):
157171
"""Returns the security settings of the user"""

0 commit comments

Comments
 (0)