Hello everybody,
I would like to share a module I created to make a VueJS Typescript SPA interact with Auth0 API using the plugin you already shared (auth0-spa-js). The main difference is that, instead of having plugins injected or a library to call, everything is handled inside a Vuex module using particular decorators which allow the code to be much cleaner.
My objective is to have this plugin in your github profile as a npm package. I would result as a contributor and you can have my plugin and apply MIT to it like I would.
Can anybody ping me so we can move on?
1 Like
Thanks for the contribution @a.sanino, I will share it with our SDK team and see if I can get some feedback on it. Can you share a github link to it?
I will share it as soon as I have the guarantee I will keep the intellectual property on the code. Just to be sure you will just not copy paste, however we can discuss here the details:
it is based on a multiple components used:
The basic idea is that I have built a vuex module using vuex class which auto interacts with auth0 and handles idToken and accessToken.
So here an example
// MyComponent.vue
<template>
<p> Logged in as {{this.name}} </p>
<button @click="login"> Login using Auth0 </button>
</template>
<script lang="ts">
import { Vue, Component } from "vue-property-decorator";
import { session, SessionModule } from "@/store/sessionModule";
@Component({})
export default class MyComponent extends Vue {
session = createProxy(session, SessionModule);
async mounted() : Promise<void> {
if (this.$route.query.callback) { // just an example, you can do it in a separated page
await this.session.handleCallback();
}
}
login() : void {
this.session.login();
}
get name(): string {
return this.session.idToken.given_name || "Not logged in"
}
}
</script>
<style></style>
If possible, please open an empty private repo under auth0 github and I will make the PR to it.
My github account is saniales (Alessandro Sanino) · GitHub
Thanks for the insight @a.sanino, I will share these details with the SDK team to see if we can find a joint path forward.
@a.sanino, would you be interested in applying to the Auth0 Guest Author program? Please keep us posted as things progress with your module
1 Like
How can I join the program?
Good morning @a.sanino, I have included a link to the Guest Authors program down below. When you get a chance give it a look and if it’s something your interested in please apply!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.