-
Notifications
You must be signed in to change notification settings - Fork 84
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
[VNDA] - Feat: add user #893
base: main
Are you sure you want to change the base?
Conversation
Tagging OptionsShould a new tag be published when this PR is merged?
|
vnda/utils/user.ts
Outdated
export const setUserCookie = (headers: Headers, accessToken: string) => { | ||
setCookie(headers, { | ||
name: AUTH_COOKIE, | ||
value: accessToken, | ||
path: "/", | ||
expires: new Date(Date.now() + ONE_WEEK_MS), | ||
httpOnly: true, | ||
secure: true, | ||
sameSite: "Lax", | ||
}); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Não vejo isso sendo usado em nenhum lugar. Quando esse cookie vai ser salvo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Não vejo isso sendo usado em nenhum lugar. Quando esse cookie vai ser salvo?
Pensei em criá-lo para usar em uma futura action de signIn - para remover a necessidade do proxy para a página de login: https://developers.vnda.com.br/reference/post-api-v2-auth-client
Mas atualmente essa action não está criada e fazemos o login por proxy, então real não tem utilidade aqui no momento. Deveria remover?
What is this Contribution About?
This Pull Request introduces the implementation of the user hook for integrating VNDA - E-commerce Platform - with Deco.cx. This hook captures the user's
accessToken
and makes a request to the VNDA API to retrieve the associated user ID.Changes Made
Utility Function:
accessToken
from the user's cookie and make a call to the VNDA API to fetch the user data.Updated
useUser
Hook:useUser
hook has been updated to incorporate the new user loading logic.Loader Implementation:
accessToken
to retrieve user information.Issue Link
Please link to the relevant issue that this pull request addresses: