Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
7.3k views
in Technique[技术] by (71.8m points)

vue.js - Login Firebase Ionic-Vue Capacitor

I am making an app that I want to compile for the web and for mobile in which I want to implement a login with firebase where I can use the different authentication methods that firebase provides.

Searching the internet I realize that there are almost no examples with Ionic-Vue (I found some with angular that I have not been able to implement with vue).

I found the package https://www.npmjs.com/package/capacitor-firebase-auth But when I try to implement it I get an error on import

import {User} from 'firebase/app';

I did the package installation

npm install --save capacitor-firebase-auth

I get the following error Module '"../../node_modules/firebase"' has no exported member 'User'. Did you mean to use 'import User from "../../node_modules/firebase"'

import {User} from 'firebase/app';
import {cfaSignIn} from 'capacitor-firebase-auth';

export default defineComponent({
  name: 'Home',
  components: {
    IonContent,
    IonHeader,
    IonPage,
    IonTitle,
    IonToolbar,
    IonButton
  },
  methods: {
    login(){
        cfaSignIn("google.com").subscribe((user: User) =>
          console.log(user.displayName)
        );
    },

error img

What would be the problem, or does anyone know a better way to implement firebase authentication in a capacitor ionic-vue project that works on both web and mobile.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...