GithubHelp home page GithubHelp logo

angular-google-plus's Introduction

๐Ÿคซ

angular-google-plus's People

Contributors

dugokontov avatar gastonrobledo-santex avatar killinit avatar ruiaraujo avatar zishe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-google-plus's Issues

Do not clean the auth response

I want to integrate GooglePlus oAuth into a third party data provider, but to do this I need the full content of the original auth response with the access_token and the expires_in fields.

Why is this library cleaning that out? Please leave it in.

Not able to fetch all the user related information like (mail di)

not able to fetch mail id of the longeing user please get me some function which will return data with mail id,
right now

GooglePlus.getUser().then(function (user) {
   debugger;
});

function is not returning mail id in some of the user.. but in some cases is working fine.
please update me on that.

Injection error

Hi,

I am trying to use it in my application using browserify, but i am getting following error:

Error: [$injector:modulerr] Failed to instantiate module googleplus due to:
Error: [$injector:nomod] Module 'googleplus' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument

I have installed it in local and global.

thank you

Set Language

Is it possible to set the language? I have an American traveling in Thailand who's testing my site, but the login prompt is displaying in Thai. It seems like Google automatically bases the language on location/IP address rather than what's set in the browser / computer. If he applies &hl=en to the end of the sign-in popup's URL, it shows up in English. Basically, I'd like to be able to pass the hl value based on what I detect as the users language.

Anyone know why Google does this? If a potential American user is on vacation in Mexico, they'll see the consent form in Spanish rather than English. There must be a reason they do this, but I don't know why.

I there any way to check if user is already authorized or not?

Currently I only changed your checkAuth function to the following (added $q):

NgGooglePlus.prototype.checkAuth = function() {
    deferred  = $q.defer();

    gapi.auth.authorize({
        client_id: options.clientId,
        scope: options.scopes,
        immediate: true
    }, this.handleAuthResult);

    return deferred.promise;
};

So when the user is loaded my app, I can check in angular run function if the user is already authorized or not:

var checkGoogleReady = $rootScope.$watch(function() {
    if(typeof gapi === 'object' && typeof gapi.auth === 'object') {
        console.log('Google API is loaded');
        checkGoogleReady(); // clear watcher

        GooglePlus.checkAuth().then(function () {
            console.log('User is already authorized');
        }).catch(function () {
            console.log('User is not authorized');
        });
    }
});

Do you have better solution for this? Can you extend your module to check if user is already authorized or not?

logout seems not to function

GooglePlus.logout() seems not to have significant effect as next time I execute .login, no username/password is asked.
Repro:

  1. login. dialog asks for username/password
  2. logout.
  3. login: client logs in automatically without asking credentials.

angular-google-plus improperly deals with logging out of Gmail

Tested in Firefox and Safari.

Procedure to replicate:

  1. Log into an account in Gmail.

  2. Log into an app using angular-google-plus

  3. Log out of that app.

  4. Log out of Gmail

  5. Attempt to log back into the app.

The app will log you in, but the window to log into a Gmail account will still appear. If an attempt is made to log in using this window, future log-ins will fail until the browser is restarted. Similarly, restarting the browser at any time after step 4 will resolve the issue.

Only load the google client.js script if gapi is undefined

We found that incorporating this module significantly slowed down our Angular 1.5 karma-jasmine tests. Since the run block of angular modules are automatically executed for every test we found that the google client.js was repeatedly inserted and loaded and this slowed down the tests. This duplicate client loading could be avoided if the angular-google-plus run function would check to see if gapi was already loaded before proceeding with the google client script insertion.

Make response Omniauth like

Like this:

{
  :provider => 'facebook',
  :uid => '1234567',
  :info => {
    :nickname => 'jbloggs',
    :email => '[email protected]',
    :name => 'Joe Bloggs',
    :first_name => 'Joe',
    :last_name => 'Bloggs',
    :image => 'http://graph.facebook.com/1234567/picture?type=square',
    :urls => { :Facebook => 'http://www.facebook.com/jbloggs' },
    :location => 'Palo Alto, California',
    :verified => true
  }
}

Cause in previous commits you removed useful info like name or link.

Options global variable must be inside module definition

The definition of the options object that will contains the information of keys and scopes should be placed inside the module.

Actual:

/**
 * Options object available for module
 * options/services definition.
 * @type {Object}
 */
var options = {};

/**
 * googleplus module
 */
angular.module('googleplus', []).

  /**
   * GooglePlus provider
   */
  provider('GooglePlus', [function() {

Must be changed to

/**
 * googleplus module
 */
angular.module('googleplus', []).

  /**
   * GooglePlus provider
   */
  provider('GooglePlus', [function() {
/**
 * Options object available for module
 * options/services definition.
 * @type {Object}
 */
var options = {};

This will prevent any collision of the variable options when use several libraries in your application.

signout causes error

There seems to be a bug in the signout function.

The " return deferred.promise;" is causing "Cannot read property 'promise' of undefined".

OAuth fails after application times out

After an hour of inactivity, my app times out and returns the user to the log-in page. If, here, the user attempts to use the google+ sign-in, they receive back an error code 401, with a message of 'Invalid Credentials'. If the time at which the app times out is shortened (to, for instance, 10 seconds), then in that case, the google+ sign-in appears to work fine.

promise is cached so logging in after failed attempt returns auto-fail

First off, great app.

The one issues,

*) First, I purposely cause a failure by clicking CANCEL on the Google Popup. The promise is resolved correctly as reject / error

*) The second time I login to Google, I accept. Expected result is success, token and my user data. Result is error.

*) logging in a second time causes successful result.

*) Reversing my sequence, Succeeding and then failing causes a similar problem (promise resolves to give me old Auth Token and my data)

Stepping through, I found on second run the promise is instantly resolved without waiting for Google. This seems to be a case Angular Promises being cached. This is particularly interesting since the promise IS correctly bound when Google returns it. It just doesn't wait for the response so I get the cached answer.

I know how to turn off caching when using the $http service, but I don't know how to do so with the $q service.

Bower Version Appears Different

The version being pulled from Bower is marked 0.1.2, but the files appear different. I noticed this issue when I tried to use the server side sign-in support.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.