\n\n\n\n\n\n","import { render } from \"./TextSeparator.vue?vue&type=template&id=78c7a6fc\"\nimport script from \"./TextSeparator.vue?vue&type=script&lang=js\"\nexport * from \"./TextSeparator.vue?vue&type=script&lang=js\"\n\nimport \"./TextSeparator.vue?vue&type=style&index=0&id=78c7a6fc&lang=scss\"\n\nimport exportComponent from \"../../../../../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","\n
\n \n
\n \n
\n
\n\n\n\n","\n
\n \n
\n {{ translate('welcomeToSuperThread') }}\n
\n
\n \n
\n \n
\n \n \n
\n {{ translate('loggingIn') }}\n
\n
\n
\n\n\n\n","\n
\n \n
\n\n\n\n","import { render } from \"./EmailField.vue?vue&type=template&id=08cd4b22\"\nimport script from \"./EmailField.vue?vue&type=script&lang=js\"\nexport * from \"./EmailField.vue?vue&type=script&lang=js\"\n\nimport exportComponent from \"../../../../../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","\n
\n \n
\n\n\n\n","import { render } from \"./ProviderLoginButton.vue?vue&type=template&id=2d617642\"\nimport script from \"./ProviderLoginButton.vue?vue&type=script&lang=js\"\nexport * from \"./ProviderLoginButton.vue?vue&type=script&lang=js\"\n\nimport exportComponent from \"../../../../../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { nanoid } from 'nanoid';\nimport { browserStorageSetItem } from './browser-storage.util';\n\n/**\n * Log-in user with google account\n * @param {string} baseUrl - endpoints base url\n * @param {string} redirectUrl - url to redirect to after successful login\n * @param {string} provider - provider to log-in with, default is 'google'\n */\nconst loginWithAuthProvider = (baseUrl, redirectUrl, provider = 'google') => {\n const encodedRedirectUrl = encodeURIComponent(redirectUrl);\n const url = `${baseUrl}/v1/auth/idp/${provider}?redirect=${encodedRedirectUrl}`;\n localStorage.setItem('login', 'authProvider');\n window.location.href = url;\n};\n\n/**\n * Log-in user app with google account for the electron app\n * @param {string} redirectUrl - url to redirect to after successful login\n * @param {function} redirectToElectronFn - function that passes the url to electron (main) process via auth-redirect-channel to open the url in the default browser\n */\nconst electronLoginWithAuthProvider = (redirectUrl, redirectToElectronFn) => {\n // used to protect against csrf attacks, we pass the random value and check it when we get response back after successful login\n const authStateParam = nanoid(15);\n\n // we hit /logout endpoint which clears cognito cookies that prevent account select\n // due to pressence of redirect_uri we are redirected to /login endoint where we must select 'sing in with google'\n // becouse cookies were cleared we are presented with account select screen, after which we are redirected to redirect_uri\n // * we only get account select screen if we are logged in with multiple google accounts in a browser\n const base = `${process.env.VUE_APP_AUTH_HOST}/logout`;\n const queryParams = `response_type=code&client_id=${process.env.VUE_APP_AUTH_CLIENT_ID}&redirect_uri=${redirectUrl}&scope=openid+email+profile&state=${authStateParam}`;\n const url = `${base}?${queryParams}`;\n\n browserStorageSetItem('login', 'authProvider');\n browserStorageSetItem('authStateParam', authStateParam);\n\n redirectToElectronFn(url);\n};\n\nexport { loginWithAuthProvider, electronLoginWithAuthProvider };\n","import { computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { browserStorageSetItem, browserStorageRemoveItem } from '@/utilities/browser-storage.util';\nimport useIsElectronApp from '@/utilities/composables/useIsElectronApp';\nimport {\n loginWithAuthProvider,\n electronLoginWithAuthProvider,\n} from '@/utilities/loginWithAuthProvider';\nimport constants from '@/utilities/constants';\nimport { loggedOutGoogleAccountKey, loggedOutAppleAccountKey } from '@/types/login';\n\ndeclare global {\n interface Window {\n electron: any;\n }\n}\n\nexport default function useProviderLogin() {\n const store = useStore();\n const { isElectronApp } = useIsElectronApp();\n\n const user = computed(() => {\n return store.getters.getUser || {};\n });\n\n const origin = computed(() => {\n return window.location.origin;\n });\n\n const redirectRoute = computed(() => {\n return store.getters.getRedirectRouteAfterLogin;\n });\n\n const redirectPath = computed(() => {\n return Object.keys(redirectRoute.value).length ? redirectRoute.value.fullPath : '';\n });\n\n const clickHandler = async (providerId: string) => {\n browserStorageRemoveItem('redirectRouteAfterLogin');\n if (user.value.id) {\n logOut(providerId);\n return;\n }\n\n logIn(providerId);\n };\n\n const logOut = async (providerId: string) => {\n await store.dispatch('logOut');\n if (providerId === 'google') {\n browserStorageSetItem(loggedOutGoogleAccountKey, true);\n } else if (providerId === 'apple') {\n browserStorageSetItem(loggedOutAppleAccountKey, true);\n }\n };\n\n const logIn = async (providerId: string) => {\n const { electron } = window;\n if (isElectronApp.value && electron?.send) {\n const vueAppEnv = process.env.VUE_APP_ENV as string;\n if (vueAppEnv in constants.desktopRedirectRoutes) {\n electronLoginWithAuthProvider(\n constants.desktopRedirectRoutes[\n vueAppEnv as keyof typeof constants.desktopRedirectRoutes\n ],\n (url: any) => electron.send('auth-redirect-channel', url)\n );\n }\n } else {\n loginWithAuthProvider(\n store.getters.getRoutes.users,\n `${origin.value}${redirectPath.value}`,\n providerId\n );\n }\n };\n\n return {\n clickHandler,\n logOut,\n logIn,\n };\n}\n","import { render } from \"./LoginForm.vue?vue&type=template&id=7c466300\"\nimport script from \"./LoginForm.vue?vue&type=script&lang=js\"\nexport * from \"./LoginForm.vue?vue&type=script&lang=js\"\n\nimport exportComponent from \"../../../../../../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { render } from \"./Login.vue?vue&type=template&id=8627866c\"\nimport script from \"./Login.vue?vue&type=script&lang=js\"\nexport * from \"./Login.vue?vue&type=script&lang=js\"\n\nimport exportComponent from \"../../../../../../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","export const loggedOutGoogleAccountKey = 'logged-out-google-account';\nexport const loggingInDifferentEmailKey = 'logging-in-different-email';\nexport const loggedOutAppleAccountKey = 'logged-out-apple-account';\n","\n
\n \n
\n\n\n\n","import { render } from \"./SmallLogo.vue?vue&type=template&id=24c7db06\"\nimport script from \"./SmallLogo.vue?vue&type=script&lang=js\"\nexport * from \"./SmallLogo.vue?vue&type=script&lang=js\"\n\nimport exportComponent from \"../../../../../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","\n