authly-me 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +19 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -59,7 +59,25 @@ class Authly {
|
|
|
59
59
|
|
|
60
60
|
// TODO : Get credits used ( app level )
|
|
61
61
|
|
|
62
|
-
//
|
|
62
|
+
// Logout Session
|
|
63
|
+
async logout(token) {
|
|
64
|
+
if (!token || token === '' || token.trim() === '') {
|
|
65
|
+
throw new Error('Token is required');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const payload = {
|
|
69
|
+
key: this.key,
|
|
70
|
+
token: token
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
let response;
|
|
74
|
+
try {
|
|
75
|
+
response = await axios.post(`${this.server_url}/v1/auth/app/logout-session`, payload);
|
|
76
|
+
return response.data;
|
|
77
|
+
} catch (error) {
|
|
78
|
+
return error.response.data;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
63
81
|
|
|
64
82
|
}
|
|
65
83
|
|