<commit_before>import clientConfig from 'utils/clientConfig'

// const getRandomString = (length) => {
    // const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
    // let text = ''
    // for (let i = 0; i < length; i += 1) {
        // text += possible.charAt(Math.floor(Math.random() * length))
    // }
    // return text
// }

const oauthConfig = {
    github: {
        name: 'Github',
        url: '/auth/github',
        authorizationEndpoint: 'https://github.com/login/oauth/authorize',
        clientId: clientConfig.github.clientId,
        redirectUrl: `${window.location.origin}/callback`,
        optionalUrlParams: [
            ['scope', 'user:email'],
            ['state', 'github']
        ],
        type: '2.0',
        popupOptions: { width: 1020, height: 618 }
    },
    google: {
        name: 'Google',
        url: '/auth/google',
        authorizationEndpoint: 'https://accounts.google.com/o/oauth2/v2/auth',
        clientId: clientConfig.google.clientId,
        redirectUrl: `${window.location.origin}/callback`,
        requiredUrlParams: [
            ['response_type', 'token']
        ],
        optionalUrlParams: [
            ['scope', 'email'],
            ['state', 'google']
        ],
        display: 'popup',
        type: '2.0',
        popupOptions: { width: 1020, height: 633 }
    },
    facebook: {
        name: 'Facebook',
        url: '/auth/facebook',
        authorizationEndpoint: 'https://www.facebook.com/v2.5/dialog/oauth',
        clientId: clientConfig.facebook.clientId,
        redirectUrl: `${window.location.origin}/callback`,
        optionalUrlParams: [
            ['scope', 'email'],
            ['state', 'facebook'],
            ['response_type', 'token']
        ],
        display: 'popup',
        type: '2.0',
        popupOptions: { width: 580, height: 400 }
    }
}


export default oauthConfig<commit_msg>Added a nested route for callback url All the provider now use code for their response type<commit_after>import clientConfig from 'utils/clientConfig'

// const getRandomString = (length) => {
    // const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
    // let text = ''
    // for (let i = 0; i < length; i += 1) {
        // text += possible.charAt(Math.floor(Math.random() * length))
    // }
    // return text
// }

const oauthConfig = {
    github: {
        name: 'Github',
        url: '/auth/github',
        authorizationEndpoint: 'https://github.com/login/oauth/authorize',
        clientId: clientConfig.github.clientId,
        redirectUrl: `${window.location.origin}/github/callback`,
        optionalUrlParams: [
            ['scope', 'user:email'],
            ['state', 'github']
        ],
        popupOptions: { width: 1020, height: 618 }
    },
    google: {
        name: 'Google',
        url: '/auth/google',
        authorizationEndpoint: 'https://accounts.google.com/o/oauth2/v2/auth',
        clientId: clientConfig.google.clientId,
        redirectUrl: `${window.location.origin}/google/callback`,
        requiredUrlParams: [
            ['response_type', 'code']
        ],
        optionalUrlParams: [
            ['scope', 'email'],
            ['state', 'google']
        ],
        popupOptions: { width: 1020, height: 633 }
    },
    facebook: {
        name: 'Facebook',
        url: '/auth/facebook',
        authorizationEndpoint: 'https://www.facebook.com/v2.5/dialog/oauth',
        clientId: clientConfig.facebook.clientId,
        redirectUrl: `${window.location.origin}/facebook/callback`,
        optionalUrlParams: [
            ['scope', 'email'],
            ['state', 'facebook'],
            ['response_type', 'code']
        ],
        popupOptions: { width: 580, height: 400 }
    }
}


export default oauthConfig
{'fraction_non_alphanumeric': 0.15118110236220472, 'fraction_numerical': 0.02047244094488189, 'mean_word_length': 2.167913549459684, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, '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': '1326520', 'n_tokens_mistral': 1188, 'n_tokens_neox': 1119, 'n_words': 221}