@merkaly/nuxt 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
|
@@ -16,15 +16,14 @@ export default defineNuxtPlugin(async ({ callHook, hook }) => {
|
|
|
16
16
|
auth0.getUser = () => self0.getUser().then((result) => user.value = result).catch((reason) => console.error("[Auth0] getUser failed", reason));
|
|
17
17
|
auth0.getTokenSilently = (options = {}) => self0.getTokenSilently(defu({ authorizationParams: { audience: $config.merkaly.auth0.audience } }, options)).then((result) => token.value = result).catch((err) => console.warn("[Auth0] getTokenSilently failed \u2013 fallback, user logged in?", err));
|
|
18
18
|
auth0.handleRedirectCallback = () => self0.handleRedirectCallback().then(({ appState }) => Promise.allSettled([auth0.getUser(), auth0.getTokenSilently()]).then(() => void navigateTo(appState?.target || "/"))).catch(() => navigateTo("/"));
|
|
19
|
-
auth0.loginWithRedirect = () => self0.loginWithRedirect({
|
|
19
|
+
auth0.loginWithRedirect = (options = {}) => self0.loginWithRedirect(defu(options, {
|
|
20
20
|
authorizationParams: {
|
|
21
21
|
audience: $config.merkaly.auth0.audience,
|
|
22
|
-
prompt: "login",
|
|
23
22
|
redirect_uri: URL.canParse($config.merkaly.auth0.callbackUrl) ? $config.merkaly.auth0.callbackUrl : location.origin.concat($config.merkaly.auth0.callbackUrl),
|
|
24
23
|
scope: "openid profile email offline_access"
|
|
25
24
|
// necesario aquí para API
|
|
26
25
|
}
|
|
27
|
-
});
|
|
26
|
+
}));
|
|
28
27
|
auth0.logout = () => self0.logout({
|
|
29
28
|
logoutParams: {
|
|
30
29
|
returnTo: URL.canParse($config.merkaly.auth0.logoutUrl) ? $config.merkaly.auth0.logoutUrl : location.origin.concat($config.merkaly.auth0.logoutUrl)
|