Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix - Android Google logout #1639

Merged
merged 2 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ class API {
error.config?.baseURL === BASE_URL
) {
if (isAndroid()) {
window.plugins.googleplus.disconnect(function(msg) {
console.log('disconnect google msg' + msg);
});
window.FirebasePlugin.unregister();
window.facebookConnectPlugin.logout(
function(msg) {
console.log('disconnect facebook msg' + msg);
Expand Down
4 changes: 1 addition & 3 deletions src/components/Settings/People/People.container.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ export class PeopleContainer extends PureComponent {

handleLogout = () => {
if (isAndroid()) {
window.plugins.googleplus.disconnect(function(msg) {
console.log('disconnect google msg' + msg);
});
window.FirebasePlugin.unregister();
window.facebookConnectPlugin.logout(
function(msg) {
console.log('disconnect facebook msg' + msg);
Expand Down
4 changes: 1 addition & 3 deletions src/components/Settings/Settings.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ export class Settings extends PureComponent {

function handleLogOutClick() {
if (isAndroid()) {
window.plugins.googleplus.disconnect(function(msg) {
console.log('disconnect google msg' + msg);
});
window.FirebasePlugin.unregister();
window.facebookConnectPlugin.logout(
function(msg) {
console.log('disconnect facebook msg' + msg);
Expand Down
4 changes: 2 additions & 2 deletions src/components/WelcomeScreen/WelcomeScreen.container.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import SignUp from '../Account/SignUp';
import ResetPassword from '../Account/ResetPassword';
import CboardLogo from './CboardLogo/CboardLogo.component';
import './WelcomeScreen.css';
import { API_URL } from '../../constants';
import { API_URL, GOOGLE_FIREBASE_WEB_CLIENT_ID } from '../../constants';
import {
isAndroid,
isElectron,
Expand Down Expand Up @@ -79,7 +79,7 @@ export class WelcomeScreen extends Component {
if (isAndroid() || isIOS()) {
const FirebasePlugin = window.FirebasePlugin;
FirebasePlugin.authenticateUserWithGoogle(
process.env.REACT_APP_GOOGLE_FIREBASE_WEB_CLIENT_SIGN_IN,
GOOGLE_FIREBASE_WEB_CLIENT_ID,
function(credential) {
window.location.hash = `#/login/googleidtoken/callback?id_token=${
credential.idToken
Expand Down
3 changes: 3 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ export const PAYPAL_CLIENT_ID =
HOSTNAME === 'app.cboard.io' && NODE_ENV === 'production'
? 'AVQiWeMc55uBVqvgXY2yifS6v9Pt2jYxtJhA3JV0UEhLiV4Mf5W9Hanxoix8542FYACVizlyU8M0yO0S'
: 'AZ2vK0luRWMX9zzwLs-Ko_B_TJxeHYvIFCgXWcNBt50wmj7oZcUw8n4cf11GgdClTVnYMuEs5vRnxVEk';
// Google related constants
export const GOOGLE_FIREBASE_WEB_CLIENT_ID =
process.env.REACT_APP_GOOGLE_FIREBASE_WEB_CLIENT_ID || '';