# Error: this.$auth0.loginWithRedirect is not a function

**URL:** <https://community.auth0.com/t/error-this-auth0-loginwithredirect-is-not-a-function/82468>\
**Category:** Get Help\
**Tags:** api, login, auth0\
**Created:** [April 27, 2022, 8:35am UTC](https://community.auth0.com/t/error-this-auth0-loginwithredirect-is-not-a-function/82468 "2022-04-27T08:35:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iionsroar](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/iionsroar/32/36922_2.png) [@Iionsroar](https://community.auth0.com/u/Iionsroar)\
**Post date:** [April 27, 2022, 8:35am UTC](https://community.auth0.com/t/error-this-auth0-loginwithredirect-is-not-a-function/82468/1 "2022-04-27T08:35:03Z")

</div>

I am following the [Auth0 quick start with Vue](https://auth0.com/docs/quickstart/spa/vuejs/01-login)

**MainLayout.vue**

I have a login button `<div><button @click="login">Log in</button></div>` for this component

```javascript
<script>
import { defineComponent, ref } from 'vue'
import EssentialLink from 'components/EssentialLink.vue'

export default defineComponent({
  name: 'MainLayout',

  components: {
    EssentialLink
  },

  methods: {
    login () {
      this.$auth0.loginWithRedirect();
    }
  },

  setup () {
    const leftDrawerOpen = ref(false)

    return {
      essentialLinks: linksList,
      leftDrawerOpen,
      toggleLeftDrawer () {
        leftDrawerOpen.value = !leftDrawerOpen.value
      }
    }
  }
})
</script>

```

**src/boot/auth0.js**

I tried to register the plugin to my [quasar bootfile (equivalent to main.js)](https://quasar.dev/quasar-cli-webpack/boot-files) `auth0.js`

```javascript
import { boot } from 'quasar/wrappers'
import { createAuth0 } from '@auth0/auth0-vue'

let auth0 = createAuth0({
    domain: "ksadhkajshds",
    client_id: "askasahsaksj",
    redirect_uri: window.location.origin,
})

export default boot(({ app }) => {
	app.config.globalProperties.$auth0 = auth0
})

export { auth0 }

```

**quasar.config.js**

I added the bootfile to my config

```javascript
// code omitted
boot: [
      
      'auth0',
      'axios',
    ],
// code omitted

```

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [April 27, 2022, 9:24am UTC](https://community.auth0.com/t/error-this-auth0-loginwithredirect-is-not-a-function/82468/2 "2022-04-27T09:24:09Z")

</div>

Hey there!

In order to handle that most effectively can I ask you to raise it as a GitHub issue in the quickstart repo so we can work on that directly with the repo maintainers? Once you have a link to it you can share it here so I can ping them. Thank you!

> **[auth0-vue-samples/01-Login at master · auth0-samples/auth0-vue-samples](https://github.com/auth0-samples/auth0-vue-samples/tree/master/01-Login)**
>
> master/01-Login

---

<div class="post-metadata">

**Author:** ![Iionsroar](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/iionsroar/32/36922_2.png) [@Iionsroar](https://community.auth0.com/u/Iionsroar)\
**Post date:** [April 27, 2022, 10:25am UTC](https://community.auth0.com/t/error-this-auth0-loginwithredirect-is-not-a-function/82468/3 "2022-04-27T10:25:56Z")

</div>

I already raised an issue but I might have opened it at the wrong repository. Do I just paste the link there or copy it entirely?

> <https://github.com/auth0/auth0-vue/issues/113>
>
> \### Describe the problem
> 
> I cannot log in using the auth0 plugin in my Quasar …project. I am following the \[Quick Start page for Vue\](https://auth0.com/docs/quickstart/spa/vuejs/01-login#add-login-to-your-application)
> 
> \<br\>
> 
> \### What was the expected behavior?
> 
> After completing the \[Add Plugin Using the Options API\](https://auth0.com/docs/quickstart/spa/vuejs/01-login#using-the-options-api) part of the quick-start page, I should be able to access the auth0 login page.
> 
> \<br\>
> 
> \### Reproduction
> 
> \- \*\*Step 1:\*\* install quasar cli \`npm i -g @quasar/cli\` 
> 
> - create quasar project \`npm init quasar\`
> 
> \- \*\*Step 2:\*\* follow configuration steps in the \[auth0 quick-start page\](https://auth0.com/docs/quickstart/spa/vuejs/01-login#using-the-options-api) and create a generic SPA in the Auth0 dashboard 
> 
> \- \*\*Step 3:\*\* install sdk \`npm install @auth0/auth0-vue\`
> 
> \- \*\*Step 4:\*\* register the plugin (in a quasar project), following the \[quasar guide\](https://quasar.dev/quasar-cli-webpack/boot-files#usage-of-boot-files)
> 
> - generate quasar boot file \`quasar new boot auth0\`
> 
> - modify the generated boot file \`src/boot/auth0.js\` file to:
> 
> - \`\`\`javascript
> import { boot } from 'quasar/wrappers'
> import { createAuth0 } from '@auth0/auth0-vue'
>       
> // "async" is optional;
> // more info on params: https://v2.quasar.dev/quasar-cli/boot-files
> export default boot(async ( { app } ) =\> {
> app.config.globalProperties.$auth0 = createAuth0({
> domain: "\<domain\_here\>",
> client\_id: "\<client\_id\_here\>",
> redirect\_uri: window.location.origin,
> })
> })
> \`\`\`
> 
> - reference the bootfile in \`quasar.config.js\` 
> 
> - \`\`\`javascript
> boot: \[
> 'auth0',
> 'axios',
> \],
> \`\`\`
> 
> - 
> 
> \- \*\*Step 5:\*\* add login to app \*\*using the options api\*\*
> 
> - modify main layout to include a login button:
> 
> - \`\`\`javascript
> \<q-toolbar-title\>
> Quasar App
> \</q-toolbar-title\>
>        
> \<div\>\<button @click="login"\>Log in\</button\>\</div\>
> \<div\>Quasar v{{ $q.version }}\</div\>
> \`\`\`
> 
> - add login method
> 
> - \`\`\`javascript
> export default defineComponent({
> name: 'MainLayout',
>       
> components: {
> EssentialLink
> },
>       
> methods: {
> login () {
> this.$auth0.loginWithRedirect();
> }
> },
>       
> setup () {
> const leftDrawerOpen = ref(false)
>       
> return {
> essentialLinks: linksList,
> leftDrawerOpen,
> toggleLeftDrawer () {
> leftDrawerOpen.value = !leftDrawerOpen.value
> }
> }
> }
> })
> \`\`\`
> 
> \- \*\*Step 6:\*\* run the app \`quasar dev\` and press the login button
> 
> \<br\>
> 
> \### Environment
> 
> \- \*\*Version of \`auth0-vue\` used:\*\* @auth0/auth0-vue@1.0.0
> \- \*\*Version of \`vue\` used: \*\*vue@3.2.33
> \- \*\*Which browsers have you tested in?\*\* Chrome, Firefox
> \- \*\*Other modules/plugins/libraries that might be involved:\*\* Quasar CLI

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [April 27, 2022, 10:27am UTC](https://community.auth0.com/t/error-this-auth0-loginwithredirect-is-not-a-function/82468/4 "2022-04-27T10:27:49Z")

</div>

No that’s fine! I’m gonna ping the repo maintainers in a few minutes.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 28, 2022, 10:03am UTC](https://community.auth0.com/t/error-this-auth0-loginwithredirect-is-not-a-function/82468/5 "2022-07-28T10:03:14Z")

</div>


