Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Carsten
    @cvantum
    I am now trying to store the data i've got by Vue.http.get() and my thoughts are spinning around a solution where i store the data in memory. But i only get an [object Object] by state.profile. Do you have any hint how i can store this data into memory to keep it like isAuthenticated?
    Davor Grubelić
    @dgrubelic
    first, you should not store client secret in your client app
    this is for server only
    for data security
    second, you can create service that will store profile for you in some internal object or in local storage
    Carsten
    @cvantum
    thanks for the solutions.. i've removed the key from client and found a way to use ẁindow.localStorage for my needs. If you need i can gave you some sample-code for OAuth2 with https://discordapp.com
    Also for server.js :)
    Davor Grubelić
    @dgrubelic
    you can send PR and i'll review it as soon as i can :)
    Carsten
    @cvantum
    PR?
    Davor Grubelić
    @dgrubelic
    Pull request :)
    Daniel Mecke
    @dmecke
    Hi there! Thanks a lot @dgrubelic for your library! Your effort is really much appreciated! :smile:
    I struggled a bit though about where to put the bindRequestInterceptor() and bindResponseInterceptor() methods though (I use axios). I eventually found out that these belong into the options of the Vue.use(), but maybe that could be highlighted in the corresponding section of the help?
    Davor Grubelić
    @dgrubelic
    Hey @dmecke , thanks for your support and thanks for reporting this to be unclear. I'll add into README.
    Daniel Mecke
    @dmecke
    cool, thanks! :-)
    Martin Hansen
    @mokkabonna
    have some issues implementing this plugin
    I try to login with github
    it opens a new window, I authorize, get redirected back, do a post to github to get the token, then redirect to SPA again with the query string token =<token>
    after that I don't know what to expect
    how does this plugin pick up the token and communicate to the main window that I am authorized?
    hope someone can help
    Davor Grubelić
    @dgrubelic
    Hi @mokkabonna , I'll be able to help you in a few hours...
    is that ok with you?
    Martin Hansen
    @mokkabonna
    sure, that would be great
    thanks @dgrubelic
    Davor Grubelić
    @dgrubelic
    Have you seen example app on github? There, you can see Github auth example
    What do you mean "i don't know what to expect"?
    Martin Hansen
    @mokkabonna
    I have looked at it, but still struggling
    is the flow I have described correct?
    Davor Grubelić
    @dgrubelic
    This is oauth standard for both oauth1 and oauth2
    Martin Hansen
    @mokkabonna
    ah, is code the expected query string param?
    i send the user directly to my server, do the post for the token there, then redirect back with the token to the vue app
    Davor Grubelić
    @dgrubelic
    that should do it
    this is all you need to do for github (except setup provider config): https://github.com/dgrubelic/vue-authenticate/blob/master/example/server.js#L88
    Martin Hansen
    @mokkabonna
    think I understand, need to change my server setup then
    what I have done is have my return url directly to the server, and not to the vue app
    Martin Hansen
    @mokkabonna
    but window don't close or request made to my server for access token
    Martin Hansen
    @mokkabonna
    was missing the redirectUri
    Martin Hansen
    @mokkabonna
    got it working now with a local server. Still struggle to get it to work with AWS lambda, only get code expired.. hmm
    Martin Hansen
    @mokkabonna
    phew got it working :)
    thanks alot
    paul van bladel
    @paulvanbladel
    Hi Davor, thanks a lot for trying to help me with interceptor problem.
    Davor Grubelić
    @dgrubelic
    Hey Paul, no problem...
    so, auth token is stored in storage but isn't sent to server?
    if token is stored in storage after auth process, that means that interceptors are working ok
    you can optionally bind exactly the same interceptors and see what the problem is when you try to send a request
    that can be done be overriding these two props in vue authenticate config:
    bindRequestInterceptor: null,
    bindResponseInterceptor: null,
    paul van bladel
    @paulvanbladel
    ok.
    this is how I configure vue-authenticate