vue + firebase auth 输出 auth/internal-error 的 console.log 而不是 auth/invalid-password
vue + firebase auth output console.log of auth/internal-error instead auth/invalid-password
我正在尝试使用 firebase 测试我的简单 vue 应用程序的身份验证,但是当我使用时,其错误的 console.log 给出输出“auth/internal-error”而不是“auth/invalid-password”给空密码
Firebase: An internal AuthError has occurred. (auth/internal-error).
<script setup>
import { ref } from 'vue'
import firebase from 'firebase/compat/app';
import 'firebase/compat/auth';
import { useRouter } from 'vue-router'
const email = ref('')
const password = ref('')
const errMsg = ref()
const router = useRouter()
const login = () => {
firebase
.auth()
.signInWithEmailAndPassword(email.value, password.value)
.then((data) => {
console.log('Successfully logged in!');
router.push('/dashboard')
})
.catch((error) => {
const errorCode = error.code;
const errorMessage = error.message;
console.log(error.message);
})
}
您不应允许密码为空的请求。在知道会发生错误之前处理错误。
我正在尝试使用 firebase 测试我的简单 vue 应用程序的身份验证,但是当我使用时,其错误的 console.log 给出输出“auth/internal-error”而不是“auth/invalid-password”给空密码
Firebase: An internal AuthError has occurred. (auth/internal-error).
<script setup>
import { ref } from 'vue'
import firebase from 'firebase/compat/app';
import 'firebase/compat/auth';
import { useRouter } from 'vue-router'
const email = ref('')
const password = ref('')
const errMsg = ref()
const router = useRouter()
const login = () => {
firebase
.auth()
.signInWithEmailAndPassword(email.value, password.value)
.then((data) => {
console.log('Successfully logged in!');
router.push('/dashboard')
})
.catch((error) => {
const errorCode = error.code;
const errorMessage = error.message;
console.log(error.message);
})
}
您不应允许密码为空的请求。在知道会发生错误之前处理错误。