How to use the hellojs.init 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.

github adngdb / processeer / client / src / app.jsx View on Github external
document.addEventListener('DOMContentLoaded', () => {
    // Init sign-in library.
    hello.init({
        github: process.env.GITHUB_CLIENT_PUBLIC_ID,
    }, {
        redirect_uri: '/redirect.html',
    });

    const loggerMiddleware = createLogger();

    const store = createStore(
        connectRouter(history)(rootReducer),
        {},
        compose(
            applyMiddleware(
                routerMiddleware(history),
                thunkMiddleware,
                loggerMiddleware,
            ),
github Syncano / website / src / services / auth.service.js View on Github external
initHello () {
    const credentials = {
      facebook: process.env.HELLO_FACEBOOK,
      google: process.env.HELLO_GOOGLE,
      github: process.env.HELLO_GITHUB
    }

    const options = {
      scope: 'email',
      redirect_uri: process.env.HELLO_REDIRECT_URI
    }

    hello.init(credentials, options)

    this.hello = hello.bind(hello)
  }
}
github Syncano / syncano-dashboard / src / apps / Account / Hello.js View on Github external
import hello from 'hellojs';

const credentials = {};
const options = {};

credentials.facebook = APP_CONFIG.FACEBOOK_ID;
credentials.google = APP_CONFIG.GOOGLE_ID;
credentials.github = APP_CONFIG.GITHUB_ID;

options.redirect_uri = `${location.protocol}//${location.host}`;
options.scope = 'email';

hello.init(credentials, options);

export default hello;
github marmelab / ZeroDollarHomePage / src / frontend / js / user / userApi.js View on Github external
export const signInWithGithub = () => new Promise((resolve) => {
    hellojs.init({
        github: GITHUB_CLIENT_ID,
    }, {
        oauth_proxy: `${API_URL}/oauthproxy`,
    });

    hellojs
        .login('github')
        .then(auth => {
            hellojs(auth.network).api('/me').then(user => {
                resolve({
                    user: {
                        access_token: auth.authResponse.access_token,
                        ...user,
                    },
                });
            });
github OpenNeuroOrg / openneuro / src / scripts / user / user.store.js View on Github external
initOAuth() {
        hello.init({google: config.auth.google.clientID}, {redirect_uri: '/'});
        this.checkUser();
    },
github ACloudGuru-Resources / Course-The_Complete_Serverless_Course / section-5 / basic-website-azure / frontend / src / App.js View on Github external
componentDidMount() {

    const {
      tenantName,
      policyName,
      redirectUrl,
      backendClientApiID,
      backendClientScopeName,
      backendClientID
    } = config;

    hello.init({
      azureAD: {
        name: 'Azure Active Directory B2C',
        oauth: {
          version: 2,
          auth: getAuthUrl(tenantName, policyName),
          grant: getGrantUrl(tenantName, policyName)
        },
        refresh: true,
        scope_delim: ' ',
        logout: function () {
          window.location = getLogoutUrl(tenantName, policyName, redirectUrl);
          return true
        },
        form: false
      }
    });
github fullstackreact / redux-module-builder-example / src / redux / modules / users.js View on Github external
import {createConstants, createReducer} from 'redux-module-builder'
import {createApiHandler, createApiAction} from 'redux-module-builder/api'

import hello from 'hellojs'

hello.init({
  twitter: __TWITTER_KEY__
}, {
  oauth_proxy: `${__API_URL__}/oauthproxy`
});

/*
 * Constants
 *
 * Basic constants can just be a name
 *  i.e. 'GET_ME'
 * and api constants can be an Object
 *  i.e. { 'GET_UPCOMING': { api: true }}
 */
export const types = createConstants('users')(
  'LOGIN',
  'LOGGED_IN',
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();
            }
        });

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