<commit_before>/**
 * @ngdoc object
 * @name refigureAuth
 * @description
 * Authentication module
 */
(function (angular) {
    'use strict';

    angular
        .module('refigureAuth', [
            'ui.router',
            'router.helper',
            'ngCookies',
            'refigureShared',
            'google-signin',
            'ngFacebook'
        ])
        .constant('authApiUri', '/api')
        .config(Config)
        .run(Run);

    Config.$inject = ['GoogleSigninProvider', '$facebookProvider'];

    function Config(GoogleSigninProvider, $facebookProvider) {
        GoogleSigninProvider.init({
            apiKey: 'GOOGLE_API_KEY',
            clientId: 'GOOGLE_CLIENT_ID',
            scope: 'profile'
        });

        $facebookProvider.setAppId('FACEBOOK_CLIENT_ID');
        $facebookProvider.setVersion('v2.9');
        $facebookProvider.setPermissions([
            'public_profile',
            'email'
        ]);
    }

    Run.$inject = ['$rootScope', 'GoogleSignin', 'auth'];

    function Run($rootScope, GoogleSignin, auth) {
        var js = document.createElement('script'),
            fjs = document.getElementsByTagName('script')[0];

        js.id = 'facebook-jssdk';
        js.src = '//connect.facebook.net/en_US/sdk.js';
        fjs.parentNode.insertBefore(js, fjs);

        $rootScope.$on('ng-google-signin:isSignedIn', function (event, isSignedIn) {
            if (isSignedIn && !auth.isAuthenticated()) {
                auth.oAuth.google(GoogleSignin.getUser().getAuthResponse()['id_token']);
            }
        });

        $rootScope.$on('fb.auth.login', function (event, opts) {
            console.log('fb.auth.login', arguments);
        });

        $rootScope.$on('fb.auth.authResponseChange', function (e, resp) {
            if (resp.status === 'connected') {
                auth.oAuth.fb(resp.authResponse.accessToken);
            }
        });
    }

})(window.angular);<commit_msg>+  !auth.isAuthenticated() check added to fb login<commit_after>/**
 * @ngdoc object
 * @name refigureAuth
 * @description
 * Authentication module
 */
(function (angular) {
    'use strict';

    angular
        .module('refigureAuth', [
            'ui.router',
            'router.helper',
            'ngCookies',
            'refigureShared',
            'google-signin',
            'ngFacebook'
        ])
        .constant('authApiUri', '/api')
        .config(Config)
        .run(Run);

    Config.$inject = ['GoogleSigninProvider', '$facebookProvider'];

    function Config(GoogleSigninProvider, $facebookProvider) {
        GoogleSigninProvider.init({
            apiKey: 'GOOGLE_API_KEY',
            clientId: 'GOOGLE_CLIENT_ID',
            scope: 'profile'
        });

        $facebookProvider.setAppId('FACEBOOK_CLIENT_ID');
        $facebookProvider.setVersion('v2.9');
        $facebookProvider.setPermissions([
            'public_profile',
            'email'
        ]);
    }

    Run.$inject = ['$rootScope', 'GoogleSignin', 'auth'];

    function Run($rootScope, GoogleSignin, auth) {
        var js = document.createElement('script'),
            fjs = document.getElementsByTagName('script')[0];

        js.id = 'facebook-jssdk';
        js.src = '//connect.facebook.net/en_US/sdk.js';
        fjs.parentNode.insertBefore(js, fjs);

        $rootScope.$on('ng-google-signin:isSignedIn', function (event, isSignedIn) {
            if (isSignedIn && !auth.isAuthenticated()) {
                auth.oAuth.google(GoogleSignin.getUser().getAuthResponse()['id_token']);
            }
        });

        $rootScope.$on('fb.auth.authResponseChange', function (e, resp) {
            if (resp.status === 'connected' && !auth.isAuthenticated()) {
                auth.oAuth.fb(resp.authResponse.accessToken);
            }
        });
    }

})(window.angular);
{'fraction_non_alphanumeric': 0.15071707953063884, 'fraction_numerical': 0.0015645371577574967, 'mean_word_length': 2.167630057803468, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1070094', 'n_tokens_mistral': 1146, 'n_tokens_neox': 1119, 'n_words': 168}