Elon Salfati
Elon Salfati

Reputation: 1687

Firebase auth listener on nuxt

I'm a bit new to vue and nuxt, and I'm using firebase authentication with a custom token generation.

I'm looking for the best place to put the onAuthChange listener, I'm trying to figure out if this should be implemented as middleware or maybe it could go somehow into the nuxt config

obviously, I want it to listen to the entire application all the time.

Upvotes: 1

Views: 567

Answers (1)

Elon Salfati
Elon Salfati

Reputation: 1687

I found what I was looking for if someone else will ever encounter this question as well,

I've moved the listener to plugins and added the plugin to the nuxt.config.js file under the plugins section.

Upvotes: 3

Related Questions