Giter Club home page Giter Club logo

vue-firebase-auth-vuex's Introduction

vue auth firebase🔥 with vuex

vue authentication firebase🔥

alt tag

Simplified Firebase authentication for vue projects with support for Facebook & Google login & Github & Twitter and with support Progressive Web Apps

Config

Step 1

Firebase Auth Provides Method Email/Password,Google,Facebook,Github,Twitter Enabled Firebase console

Step 2

Initialize Firebase At main.js Firebase Credentials

firebase.initializeApp({
    apiKey: '',
    authDomain: '',
    databaseURL: '',
    projectId: '',
    storageBucket: ''
})

Installation

# Git Clone Project
git clone [email protected]:aofdev/vue-firebase-auth-vuex.git

# Cd project
cd vue-firebase-auth-vuex

# install dependencies
npm install || yarn install

# serve with hot reload at localhost:8080
npm run dev || yarn dev

# build for production with minification and to build Progressive Web Apps
npm run build || yarn build

vue-firebase-auth-vuex's People

Contributors

aofdev avatar dickv avatar hkd987 avatar shershen08 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vue-firebase-auth-vuex's Issues

(logout on Profile/ when browser is refreshed) => Cannot read property 'name' of null

Description:
Hi,

First, thanks for your code.
However there is actually a user-case witch create a bug:

0- Open the dev chrome console
1- SignIn (or SignUp) via google auth
2- When you reach /profile, refresh your browser (F5), you'll be auto-signed to the app
3- Click on logout when you are on the profile/ route.

This error display: Cannot read property 'name' of null

I think the logout make a change somewhere and the component try to reload but as we have destroy the session, the name became null

Can you help me ?

Thanks

Cannot reach Routes with AuthGuard

First I want to thank you for this good starting point!

I have a problem with the routing system here, as I cannot reach /profile or /dashboard (whatever restricted route given), as it redirects me always to the "/" home page.

I do not want to have a seperate /signup and /signIn page, so I store them in a dialog and the login and signup itself works fine and as expected.

Somehow, within the auth-guard.js I set in the else condition next('/') instead next('/signup') (as I dont want to have this extra route)

Is this maybe causing the problem? I did not make any other changes to your code, besides this one.

If you need further information, please contact me.

Here is my router index.js and auth-guard.js

import Vue from 'vue'
import Router from 'vue-router'
import AuthGuard from './auth-guard'


const Home = () => import('@/components/Home')
const Profile = () => import('@/components/User/Profile')
const Dashboard = () => import('@/components/Dashboard/Layout')

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home
    },
    {
      path: '/dashboard',
      name: 'Dashboard',
      component: Dashboard,
      beforeEnter: AuthGuard
    },
    {
      path: '/profile',
      name: 'Profile',
      component: Profile,
      beforeEnter: AuthGuard,
      children: [
        {
          path: '/settings',
          name: 'Settings',
          component: () => import('@/components/User/Settings')
        }
      ]
    }
  ],
  mode: 'history'
})

and the auth-guard.js

import {store} from '../store'

export default (to, from, next) => {
  if (store.getters.user) {
    next()
  } else {
    next('/')
  }
}

Email Link Authentication

Hi,

I like your App a good point to start but as a new user to Vue, I'll make an offer to add the Email Link Authentication.

That isn't hard, where to put the callback though?

If in the main.js the guard will not allow access to the /profile so user will be back to the /signin then the answer from Firebase will come and the user will be redirected back to the /profile.

Setting the flag loading: false doesn't work either because the user almost certainly will be back to the new tab by the email link.

This is how it works in my app right now. Doesn't looks right.

As I said I'm new to Vue I'll be glad to see a right way to add this way of Authentication.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.