Giter Site home page Giter Site logo

Comments (9)

pi0 avatar pi0 commented on May 9, 2024 9

setToken docs are ready and working :)
https://github.com/nuxt/modules/tree/master/modules/axios#helpers

from legacy-modules.

pi0 avatar pi0 commented on May 9, 2024 1

Hmm i can't test now but seems it should be attached to prototype instead until bug resolved please use an alternative like this: $axios.defaults.headers.common.Authorization= toekn

from legacy-modules.

rahul9874563210 avatar rahul9874563210 commented on May 9, 2024 1

@kaungmyatlwin can you give example using nuxt/auth module for external API authentication with custom function.

detail issue is here
nuxt-community/auth-module#216

from legacy-modules.

pi0 avatar pi0 commented on May 9, 2024

Hi. Sorry for currently lack of it's documentation. Actually i've just left it until auth module is ready. For setting authentication token, anywhere that you have access to $axios (see docs) can call like this:

// This will add `Authentication: Bearer ....`  header to all requests
$axios.setToken('Token from API or Cookies', 'Bearer')

from legacy-modules.

ImadBoumzaoued avatar ImadBoumzaoued commented on May 9, 2024

Hey thanks for the reply, I don't know what I'm doing wrong but when I do it like this

this.$axios.setToken(token, false)

I get setToken is not a function, knowing that this.$axios.post is working

from legacy-modules.

ImadBoumzaoued avatar ImadBoumzaoued commented on May 9, 2024

Ok I'll use the alternative solution.
Thanks a lot :)

from legacy-modules.

Mr-Black-Dahlia avatar Mr-Black-Dahlia commented on May 9, 2024

@pio the link leads me to a 404

from legacy-modules.

Flyer3d avatar Flyer3d commented on May 9, 2024

@pi0 Link doesn't work! 404

from legacy-modules.

kaungmyatlwin avatar kaungmyatlwin commented on May 9, 2024

@indiecore-fm @Flyer3d https://auth.nuxtjs.org/api/auth.html

from legacy-modules.

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.