https://supertokens.com/ logo
Docs
Join the conversationJoin Discord
Channels
community
contributing
general
github-activity
info
introductions
new-releases
random
security
support-questions
welcome-0xdelusion
welcome-aj-ya
welcome-aleksandrc
welcome-alpinjs
welcome-amberlamps1
welcome-andrew-rodriguez
welcome-ankit-choudhary
welcome-anthony-stod-custodio
welcome-call-in
welcome-chwalbox
welcome-claybiokiller
welcome-co7e
welcome-cosmoecwsa
welcome-devdag
welcome-dinso
welcome-drebotelho
welcome-elio
welcome-ernest
welcome-foxbarrington
welcome-fromscratch
welcome-galto4ir
welcome-goetzum
welcome-hay-kot
welcome-himanshu-kukreja
welcome-hossambarakat
welcome-ichikawakazuto
welcome-jahir9991
welcome-jamesl
welcome-jerry123424
welcome-john-oliver
welcome-jonas-alexanderson
welcome-jxyz
welcome-kelvinwop
welcome-kraz
welcome-lancekey
welcome-leoo
welcome-lukeacollins
welcome-m-j-mon
welcome-malik-khoja
welcome-marco
welcome-mardadi
welcome-meshguy
welcome-metamorph
welcome-mike-tectu
welcome-mirzok
welcome-mozomig
welcome-naberyou66_
welcome-nacer
welcome-namratha
welcome-naveenkumar
welcome-nightlight
welcome-nischith
welcome-notankit
welcome-olawumi
welcome-pavan-kumar-reddy-n
welcome-pineappaul
welcome-poothebear
welcome-rick
welcome-samuel-qosenergy
welcome-samuelstroschein
welcome-shubhamgoel23
welcome-shubhamkaushal
welcome-sidebar
welcome-surajsli
welcome-suyash_
welcome-syntaxerror
welcome-tauno
welcome-tauno
welcome-tawnoz
welcome-teclali
welcome-tls
welcome-turbosepp
welcome-vikram_shadow
welcome-yann
Powered by Linen
support-questions
  • s

    Sun Walker

    04/13/2020, 7:47 PM
    It could just be /users/categories/:categoryId
  • s

    Sun Walker

    04/13/2020, 7:48 PM
    And then the api could add it to current user
  • r

    rp

    04/13/2020, 7:48 PM
    Yea!
  • r

    rp

    04/13/2020, 7:48 PM
    That’s ideal
  • r

    rp

    04/13/2020, 7:49 PM
    So u don’t need userId of the current user in the frontend
  • r

    rp

    04/13/2020, 7:49 PM
    If u absolutely do require it, then u can call an API to get the userId of the currently logged in user and then store that in memory
  • s

    Sun Walker

    04/13/2020, 7:49 PM
    Ahhhh that is interesting, making my brain hurt
  • r

    rp

    04/13/2020, 7:49 PM
    Haha.. it is complex. But it’s the right way
  • s

    Sun Walker

    04/13/2020, 7:50 PM
    I've always done it the other way, but you really dont need to!
  • s

    Sun Walker

    04/13/2020, 7:51 PM
    Current user is defined by access token All operations are in the context of current user so should operate on current user Unless operation specifically states another user like /users/:userId to show another user
  • r

    rp

    04/13/2020, 7:51 PM
    Exactly.
  • s

    Sun Walker

    04/13/2020, 7:51 PM
    But I should send the User ID with requests like /users though right?
  • s

    Sun Walker

    04/13/2020, 7:51 PM
    Must be
  • r

    rp

    04/13/2020, 7:51 PM
    What is /users?
  • s

    Sun Walker

    04/13/2020, 7:52 PM
    [ {username: rp, id: 38472-hdakwd-djawd } , { username: Stephano, id: skjdad-3413-akjdha } ]
  • s

    Sun Walker

    04/13/2020, 7:52 PM
    Response ^
  • r

    rp

    04/13/2020, 7:52 PM
    Not sure I understand. Sorry
  • s

    Sun Walker

    04/13/2020, 7:53 PM
    So if I hit /users endpoint, I get all users and show them on the page
  • s

    Sun Walker

    04/13/2020, 7:53 PM
    But the API response is that ^
  • r

    rp

    04/13/2020, 7:53 PM
    Okay. That’s not an issue
  • s

    Sun Walker

    04/13/2020, 7:53 PM
    Ahh I see
  • r

    rp

    04/13/2020, 7:54 PM
    Also, I’m a little sleepy now (it’s 1:24 am here). So we can chat tomorrow?
  • s

    Sun Walker

    04/13/2020, 7:54 PM
    Np, I think I understood fully!
  • r

    rp

    04/13/2020, 7:54 PM
    Cheers! 👍
  • s

    Sun Walker

    04/13/2020, 7:54 PM
    Have a good night!
  • r

    rp

    04/13/2020, 7:54 PM
    Have a good evening
  • s

    Sun Walker

    04/14/2020, 3:44 PM
    Does anyone know why I get session expired when the url is incorrect? localhost:4000/users/346c10cd-49d6-43a0-8a12-e22b9515b2fc <- works of course localhost:4000/users//346c10cd-49d6-43a0-8a12-e22b9515b2fc <- throws session expired (notice the //) Video of this: https://imgur.com/cZdnbMV
  • r

    rp

    04/14/2020, 3:47 PM
    Is the long string a userId?
  • s

    Sun Walker

    04/14/2020, 3:47 PM
    Yeah, UUID
  • r

    rp

    04/14/2020, 3:48 PM
    The userId of the currently logged in user?
Powered by Linen
Title
r

rp

04/14/2020, 3:48 PM
The userId of the currently logged in user?
View count: 1