简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM