No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How I set Auth headers in apllo client after login

    Help
    2
    2
    621
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      ghosteye1.wg last edited by

      I’m using https://github.com/quasarframework/app-extension-apollo for graphql. The all config related to above plugin store in apollo-client-config.js file. Currently I implemented as follows

      export default function (/* { app, router, store, ssrContext, urlPath, redirect } */) {
          return {
            default: {
                
              httpLinkConfig: {
                headers: { 'Authorization': 'Bearer ' +localStorage.getItem('access_token')},
                uri: process.env.GRAPHQL_URI || 'http://localhost:8080/api/graphql'
              },
              cacheConfig: {},
              additionalConfig: {}
            },
            ssrOnServer: {
              additionalConfig: {
                ssrMode: true
              }
            },
            ssrOnClient: {
              additionalConfig: {
                ssrForceFetchDelay: 100
              }
            }
          }
        }
        
      

      I want set authorization header user after login.

      dobbel 1 Reply Last reply Reply Quote 0
      • dobbel
        dobbel @ghosteye1.wg last edited by

        @ghosteye1-wg

        https://forum.quasar-framework.org/topic/6746/how-to-update-auth-token-using-app-extension-apollo-each-time-a-user-log-in

        1 Reply Last reply Reply Quote 0
        • First post
          Last post