updates
This commit is contained in:
parent
5375a39e1a
commit
3949bf7cc1
@ -19,12 +19,15 @@ const parseClientCookies = require("../utils/parseClientCookies");
|
||||
*
|
||||
* @async
|
||||
*
|
||||
* @param {object} params - Single object passed
|
||||
* @param {string|null} params.googleClientId - Google client Id if applicable
|
||||
*
|
||||
* @requires localStorageUser - a "user" JSON string stored in local storage with all
|
||||
* the necessary user data gotten from the server
|
||||
*
|
||||
* @returns {Promise<boolean>} - Return
|
||||
*/
|
||||
module.exports = async function logout() {
|
||||
module.exports = async function logout(params) {
|
||||
/**
|
||||
* == Initialize
|
||||
*
|
||||
@ -73,6 +76,9 @@ module.exports = async function logout() {
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
if (socialId) {
|
||||
const googleClientId = params.googleClientId;
|
||||
|
||||
if (googleClientId) {
|
||||
const googleScript = document.createElement("script");
|
||||
googleScript.src = "https://accounts.google.com/gsi/client";
|
||||
googleScript.className = "social-script-tag";
|
||||
@ -90,7 +96,7 @@ module.exports = async function logout() {
|
||||
////////////////////////////////////////
|
||||
|
||||
google.accounts.id.initialize({
|
||||
client_id: clientId,
|
||||
client_id: googleClientId,
|
||||
});
|
||||
|
||||
google.accounts.id.revoke(socialId, (done) => {
|
||||
@ -104,6 +110,11 @@ module.exports = async function logout() {
|
||||
////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
////////////////////////////////////////
|
||||
} else {
|
||||
resolve(true);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "datasquirel",
|
||||
"version": "1.1.47",
|
||||
"version": "1.1.48",
|
||||
"description": "Cloud-based SQL data management tool",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
Loading…
Reference in New Issue
Block a user