question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Constantly closing login window

See original GitHub issue

Hi guys, I’m implementing react-google-login to my app and it seems there’s a problem somewhere in library. Here is my code:

_layoutDumb.jsx

import React from 'react';
import { Route, Link } from 'react-router-dom';
import { Container, Segment, Button, Input, Icon } from 'semantic-ui-react';
import GoogleLogin from 'react-google-login';

import _appSmart from 'smart/_app.jsx';

export default (props) => {
    return (
        <div>
            <Route exact path='/' render={() => {
                return (
                    <div className='_ login form'>
                        <GoogleLogin
                            clientId='714689519066-v5g1o9hehsg1kko7jgpdrre7kojlahi1.apps.googleusercontent.com'
                            onSuccess={props.googleResponse}
                            onFailure={props.googleResponse}
                            autoLoad={true}
                            style={{}}
                            className='ui google plus large button' >
                            <Icon name='google' /> Přihlásit
                        </GoogleLogin>
                    </div>
                );
            }} />
            <Route path='/app' component={_appSmart} />
        </div>
    );
}

_layoutSmart.jsx

import React from 'react';
import update from 'react-addons-update';

import _layoutDumb from 'dumb/_layout.jsx';

export default class extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            googleResponse: (response) => { console.log(response); }
        };
    }

    render() {
        return (
            _layoutDumb(this.state)
        );
    }
}

I’m able to login within the popup login window and grant application permission to get user data/info and then the window automatically closes and I get an error Object {error: "popup_closed_by_user"}. Since then I get this exact same error every time I click on login button. Is it a problem of library?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
thakurinboxcommented, Jul 17, 2017

Add Authorized JavaScript origins in the following order if you are using localhost :

screen shot 2017-07-17 at 8 32 33 am

Note that you need to add one with port and one without port. Replace the port with your 😛

2reactions
patrik-simunic-czcommented, Apr 3, 2017

So, I’ve just solved the issues. Problem was, origin url was not allowed, but instead of getting not valid origin error, the window auto closed and I got popup closed by user error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows 10 - computer keeps closing programs and going ...
In the last few days, my Windows 10 machine keeps closing my programs and returning to the login screen when left idle for...
Read more >
Login window closes after successful login, but client still waiting
Using AnyConnect Client with corporate SAML/SSO, after completing sign-in details in the popup login window (embedded browser) there is ...
Read more >
10 Instant Ways to Fix Computer Keeps Crashing Windows 10
1. Cool the Computer, It is recommended to open one side panel of the case when using the computer in summer...Full steps ;...
Read more >
Windows 10 Login Crashes after Upgrade, How to Fix
“My Asus laptop keeps crashing upon entering my password on the login screen. After the latest Windows 10 update, I attempted to log...
Read more >
Fixed: Remote Desktop Closes Immediately After Login
If Remote Desktop closes unexpectedly or Windows crashes, use the System File Checker to scan Windows and restore your files. Step 1. In...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found