Skip to content
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

Mettre le OAuthServiceAPI dans le store #147

Open
DavidBruant opened this issue Dec 10, 2023 · 0 comments
Open

Mettre le OAuthServiceAPI dans le store #147

DavidBruant opened this issue Dec 10, 2023 · 0 comments
Projects

Comments

@DavidBruant
Copy link
Contributor

Actuellement, on le stocke dans une variable et on a une fonction qui le récupère

let oAuthServiceAPI
/**
* @returns {OAuthServiceAPI}
*/
export const getOAuthServiceAPI = () => {
// @ts-ignore
if (oAuthServiceAPI) {
return oAuthServiceAPI
}
const oAuthProvider = store.state.oAuthProvider
if (!oAuthProvider) {
console.info("L'utilisateur n'est pas connecté. Redirection vers /")
page('/')
throw new TypeError('Missing accessToken or provider name')
}
oAuthServiceAPI = makeOAuthServiceAPI(oAuthProvider)
return oAuthServiceAPI
}

À la place, on pourrait l'avoir dans le store directement

Il est plausible que ça remplace complètement oAuthProvider qui, je crois n'est utilisé que pour créé le OAuthServiceAPI (il faut quand même pouvoir le stocker, mais on peut le rajouter en propriété de OAuthServiceAPI)

@DavidBruant DavidBruant added this to En cours 🐛 in Grainerie Jan 2, 2024
@maiwann maiwann moved this from En cours 🐛 to Grainerie 🌱 in Grainerie Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Grainerie
Grainerie 🌱
Development

No branches or pull requests

1 participant