Giter VIP home page Giter VIP logo

Comments (9)

dgrubelic avatar dgrubelic commented on August 22, 2024

How did you include VueAuthenticate?

from vue-authenticate.

arysom avatar arysom commented on August 22, 2024

import VueAuthenticate from 'vue-authenticate'
I'm doing it inside store.js

from vue-authenticate.

dgrubelic avatar dgrubelic commented on August 22, 2024

Yes, i thought so... For ES6 (i have to cover that case in README.md) you can still use:

import { VueAuthenticate } from 'vue-authenticate'

const authInstance = new VueAuthenticate($http, {
  // options
})

since your your code is actually importing module file, which is dist/vue-authenticate.es2015.js file which has export { VueAuthenticate } at the end of the file https://github.com/dgrubelic/vue-authenticate/blob/master/dist/vue-authenticate.es2015.js#L1270

For all other use cases (ES5, CommonJS) you need to use VueAuthenticate.factory($http, options) to create instance.

from vue-authenticate.

arysom avatar arysom commented on August 22, 2024

hmm now I have Uncaught TypeError: Cannot read property 'interceptors' of undefined

from vue-authenticate.

dgrubelic avatar dgrubelic commented on August 22, 2024

This means that you didn't load vue-resource or vue-axios (or pure axios) before you initialized vue-authenticate library.

Can you gist your code?

Also, you can find working example here:

Repo: https://github.com/dgrubelic/vue-authenticate-site
Auth service: https://github.com/dgrubelic/vue-authenticate-site/blob/master/src/services/auth.js
Store auth module: https://github.com/dgrubelic/vue-authenticate-site/blob/master/src/store/auth.js

from vue-authenticate.

dgrubelic avatar dgrubelic commented on August 22, 2024

Current version is v1.2.3 so please update and let me know if issue still persists.

from vue-authenticate.

arysom avatar arysom commented on August 22, 2024

I'll be inspecting in the morning,for sure, and I'll let you know. Best regards.

from vue-authenticate.

arysom avatar arysom commented on August 22, 2024

Now it's ok 👍 I had to pass whole object to VueAuthenticate, earlier it was Vue.$http, I put my files on gist for reference. Thank you!

Vue authenticate site is great example, I will study it carefully:)

from vue-authenticate.

dgrubelic avatar dgrubelic commented on August 22, 2024

Great, i'm glad you resolved it and that everything works as it should. Closing issue...

from vue-authenticate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.