How to use the hellojs function in hellojs

To help you get started, we’ve selected a few hellojs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OpenNeuroOrg / openneuro / src / scripts / user / user.store.js View on Github external
signOut(uploadStatus) {
        let signout = true;
        if (uploadStatus === 'uploading') {
            signout = confirm('You are currently uploading files. Signing out of this site will cancel the upload process. Are you sure you want to sign out?');
        }
        if (signout) {
            hello('google').logout().then(() => {
                upload.setInitialState();
                this.clearAuth();
                router.transitionTo('signIn');
            }, () => {
                // signout failure
            });
        }
    },
github conversejs / converse.js / src / converse-oauth.js View on Github external
async oauthLogin (ev) {
                ev.preventDefault();
                const id = ev.target.getAttribute('data-id');
                this.provider = _converse.oauth_providers.get(id);
                this.oauth_service = hello(id);

                const data = {};
                data[id] = this.provider.get('client_id');
                hello.init(data, {
                    'redirect_uri': '/redirect.html'
                });

                await this.oauth_service.login();
                this.fetchOAuthProfileDataAndLogin();
            }
        });
github adngdb / processeer / client / src / actions / signin.jsx View on Github external
return (dispatch) => {
        hello('github').logout()
        .then(() => {
            dispatch(receiveSignedOut());
        }, console.log.bind(console));
    };
}
github fullstackreact / redux-module-builder-example / src / redux / modules / users.js View on Github external
*     		errors: null,
 *     		events: payload
 *     	}
 *    })
 *
 */
export const reducer = createReducer({
  [types.LOGGED_IN]: (state, {payload}) => {
    return {
      ...state,
      currentUser: payload.authResponse
    }
  }
});

const twitterAuth = hello('twitter').getAuthResponse();

const currentUser = !!twitterAuth && !twitterAuth.error && twitterAuth
/*
 * The initial state for this part of the component tree
 */
export const initialState = {
  loading: false,
  errors: null,
  currentUser: currentUser
};
github marmelab / ZeroDollarHomePage / src / frontend / js / user / userApi.js View on Github external
.then(auth => {
            hellojs(auth.network).api('/me').then(user => {
                resolve({
                    user: {
                        access_token: auth.authResponse.access_token,
                        ...user,
                    },
                });
            });
        }, err => resolve({ error: err.error }));
});
github OpenNeuroOrg / openneuro / src / scripts / user / user.store.js View on Github external
isTokenValid() {
        var session = hello('google').getAuthResponse();
        var currentTime = (new Date()).getTime() / 1000;
        return session && session.access_token && session.expires > currentTime;
    },
github fullstackreact / redux-module-builder-example / src / redux / modules / users.js View on Github external
loginWithTwitter: () => (dispatch, getState) => {
    hello('twitter').login()
      .then(res => {
        dispatch({type: types.LOGGED_IN, payload: res});
      }, err => {
        dispatch({type: types.ERROR_LOGGING_IN, payload: res});
      })
  }
}
github OpenNeuroOrg / openneuro / src / scripts / user / user.store.js View on Github external
this.checkAuth((token) => {
                this.update({token: token});
                hello('google').api('/me').then((profile) => {
                    this.update({google: profile});
                    crn.verifyUser((err, res) => {
                        if (res.body.code === 403) {
                            this.signOut();
                        } else {
                            window.localStorage.scitranUser = JSON.stringify(res.body);
                            this.update({scitran: res.body});
                        }
                    });
                }, () => {
                    this.setInitialState();
                });
            }, this.clearAuth);
        } else {
github OpenNeuroOrg / openneuro / src / scripts / user / user.store.js View on Github external
signIn(options) {
        let transition = options.hasOwnProperty('transition') ? options.transition : true;
        this.update({loading: true});
        hello('google').login({scope: 'email,openid'}, (res) => {
            if (res.error) {
                this.update({loading: false});
                return;
            }
            this.update({token: res.authResponse.access_token});
            hello(res.network).api('/me').then((profile) => {
                crn.verifyUser((err, res) => {
                    if (res.body.code === 403) {
                        let user = {
                            _id: profile.email,
                            firstname: profile.first_name,
                            lastname: profile.last_name
                        };
                        crn.createUser(user, (err, res) => {
                            if (res.body.status === 403) {
                                this.clearAuth();
github adngdb / processeer / client / src / actions / signin.jsx View on Github external
return (dispatch) => {
        hello('github').api('me')
        .then((user) => {
            dispatch(receiveGithubUsername(user.name));
        });
    };
}

hellojs

A clientside Javascript library for standardizing requests to OAuth2 web services (and OAuth1 - with a shim)

MIT
Latest version published 1 year ago

Package Health Score

62 / 100
Full package analysis