Muhammad Awais
Google Auth scopes for nuxt-auth-utils
Hello everyone, I'm trying to integrate google sign-in in my app. And I have added the scopes for the birthday, gender and country. But the user returned by the
nuxt-auth event
have basic profile properties only. I have to make another api call to extract extra information. Is there any way to get all the properties on the user
returned after authentication is successful.1 replies
Handling multiple modals.
How can we handle multiple modals within the Nuxt app. I have separate modals for signup, login, password reset and some other things. But I'm unable to manage them globally. I have tried
useState
but it throws the error cannot stringify functions. Here are my implementations:
usemodal works as a controller for single modal
define-modals defines all the modals available.
Inject/provide were not also helpful as state is not SSR friendly in that case.11 replies
fetch wrapper for api calls
Hello people,
I have struggling with creating a nice wrapper around $fetch from a long time now. Here is a complete overview of what I want. A function that I can use for authenticated requests and when a request gives unauthorized error (401) means the current auth token is expired then I want to call refresh token api and update the auth token, retry the previous request with new token.
Here is what I have been able to come up with:
Please review this and provide your valuable advice.
Another thing that I have struggled with a lot is use of
useAsyncData
or useFetch
for requests that don’t involve reactive values. These requests can be signup, login or requests that are needed to be sent on some user action. How should I use my fetch wrapper should I use it with useAsyncData
for a much nicer error handling or use try catch
Thank you very much1 replies
Run time config visible in page source
Hi everyone, I'm using public runtime config to store base url of my backend application but client doesn't want the url to be visible in the page source. Nuxt attaches public configs to window object and those are visible in page source. What can be the better way to sotre base url. I'm using graphql.
13 replies
State Management Advice
Hi everyone, I have a lot of nesting components inside a single component in which I need to share the state that means I have to pass nested props that look kinda ugly to me and then the state is also shared among two components on the same page. Currently I'm using Pinia store but that makes it a global state that stays throughout the lifecycle of the whole app. I'm seeking any advice that anybody can give on this.
Thanks for your time
3 replies