diff --git a/package-lock.json b/package-lock.json index 3a2c8d6..7ca2b89 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,7 @@ "@types/node": "^20.2.1", "@types/shortid": "^0.0.29", "@types/turndown": "^5.0.1", - "@vitejs/plugin-vue": "^4.2.2", + "@vitejs/plugin-vue": "^4.2.3", "@vue/eslint-config-prettier": "^7.1.0", "@vue/eslint-config-typescript": "^11.0.3", "@vue/tsconfig": "^0.4.0", @@ -2339,9 +2339,9 @@ } }, "node_modules/@vitejs/plugin-vue": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-4.2.2.tgz", - "integrity": "sha512-kNH4wMAqs13UiZe/2If1ioO0Mjz71rr2oALTl2c5ajBIox9Vz/UGW/wGkr7GA3SC6Eb29c1HtzAtxdGfbXAkfQ==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-4.2.3.tgz", + "integrity": "sha512-R6JDUfiZbJA9cMiguQ7jxALsgiprjBeHL5ikpXfJCH62pPHtI+JdJ5xWj6Ev73yXSlYl86+blXn1kZHQ7uElxw==", "dev": true, "engines": { "node": "^14.18.0 || >=16.0.0" @@ -14086,9 +14086,9 @@ } }, "@vitejs/plugin-vue": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-4.2.2.tgz", - "integrity": "sha512-kNH4wMAqs13UiZe/2If1ioO0Mjz71rr2oALTl2c5ajBIox9Vz/UGW/wGkr7GA3SC6Eb29c1HtzAtxdGfbXAkfQ==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-4.2.3.tgz", + "integrity": "sha512-R6JDUfiZbJA9cMiguQ7jxALsgiprjBeHL5ikpXfJCH62pPHtI+JdJ5xWj6Ev73yXSlYl86+blXn1kZHQ7uElxw==", "dev": true, "requires": {} }, diff --git a/package.json b/package.json index 853d3e5..c360e75 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "@types/node": "^20.2.1", "@types/shortid": "^0.0.29", "@types/turndown": "^5.0.1", - "@vitejs/plugin-vue": "^4.2.2", + "@vitejs/plugin-vue": "^4.2.3", "@vue/eslint-config-prettier": "^7.1.0", "@vue/eslint-config-typescript": "^11.0.3", "@vue/tsconfig": "^0.4.0", diff --git a/postcss.config.js b/postcss.config.js index 2e7af2b..28ce276 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,4 +1,5 @@ export default { + plugins: { tailwindcss: {}, autoprefixer: {}, diff --git a/src/components/Auth.vue b/src/components/Auth.vue index f0f8125..de3f0df 100644 --- a/src/components/Auth.vue +++ b/src/components/Auth.vue @@ -4,13 +4,35 @@ import 'firebase/compat/auth' import * as firebaseui from 'firebaseui' import 'firebaseui/dist/firebaseui.css' +const emit = defineEmits<{ + signedIn: [authResult: any] +}>() + const ui = firebaseui.auth.AuthUI.getInstance() || new firebaseui.auth.AuthUI(firebase.auth()) -onMounted(() => { - ui.start('#auth', { - signInOptions: [firebase.auth.EmailAuthProvider.PROVIDER_ID] - // Other config options... - }) -}) + +const uiConfig = { + signInOptions: [ + firebase.auth.EmailAuthProvider.PROVIDER_ID, + firebase.auth.GoogleAuthProvider.PROVIDER_ID, + firebase.auth.FacebookAuthProvider.PROVIDER_ID + ], + callbacks: { + signInSuccessWithAuthResult: function (authResult: any) { + // var user = authResult.user + // var credential = authResult.credential + // var isNewUser = authResult.additionalUserInfo.isNewUser + // var providerId = authResult.additionalUserInfo.providerId + // var operationType = authResult.operationType + // Do something with the returned AuthResult. + // Return type determines whether we continue the redirect + // automatically or whether we leave that to developer to handle. + emit('signedIn', authResult) + return false + } + } + // Other config options... +} +onMounted(() => ui.start('#auth', uiConfig))