Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: onFetchUser hook for local strategy #897

Closed
reslear opened this issue Dec 5, 2020 · 1 comment
Closed

feature request: onFetchUser hook for local strategy #897

reslear opened this issue Dec 5, 2020 · 1 comment

Comments

@reslear
Copy link

reslear commented Dec 5, 2020

like $auth.onRedirect
and extend axios interceptor between hook resetInterceptor

motivation:

draft:

// plugins/auth.ts
$auth.onUserFetch((config: AxiosRequestConfig) => {
  config.params['lang'] = app.i18n.locale;
  app.$toast.show('getting user...');
  return config;
});

Снимок экрана 2020-12-05 в 03 19 03

or refactor Interceptor and resetInterceptor for available in$axios.onRequest
thx

@reslear reslear changed the title Add onFetchUser hook for local strategy feature request: onFetchUser hook for local strategy Dec 5, 2020
@reslear
Copy link
Author

reslear commented Dec 6, 2020

temporary solutions for use params:

// plugins/auth.ts
$auth.strategies.local.options.endpoints.user.url = `${BASE_URL}/api/user?lang=${app.i18n.locale}`;

and combine hook i18n.beforeLanguageSwitch with this.$auth.setUser(user)

or use vuex for store user data and fetch in nuxtServerInit

@nuxt-community nuxt-community locked and limited conversation to collaborators Jan 24, 2022
@bmulholland bmulholland converted this issue into discussion #1605 Jan 24, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

2 participants