clerk / javascript

Official JavaScript repository for Clerk authentication
https://clerk.com
MIT License
1.13k stars 255 forks source link

@clerk/express getAuth #4469

Open wyvern800 opened 3 days ago

wyvern800 commented 3 days ago

Preliminary Checks

Reproduction

#

Publishable key

pk_test_ZXhvdGljLWNyYWItNzUuY2xlcmsuYWNjb3VudHMuZGV2JA

Description

Steps to reproduce:

Try calling 'getAuth' from the lib, in dev mode

Expected behavior: will only return: { ... [1] sessionId: 'example session id, [1] userId: 'example user id', [1]

seems like everything is null, it was supposed to come with a userId and a sessionId.

Actual behavior: will only return: { [1] sessionClaims: null, [1] sessionId: null, [1] userId: null, [1] actor: null, [1] orgId: null, [1] orgRole: null, [1] orgSlug: null, [1] orgPermissions: null, [1] __experimental_factorVerificationAge: null, [1] getToken: [Function: getToken], [1] has: [Function: has], [1] debug: [Function (anonymous)], [1]

seems like everything is null, it was supposed to come with a userId and a sessionId.

Environment

System:
    OS: Windows 10 10.0.19045
    CPU: (16) x64 AMD Ryzen 7 5700X 8-Core Processor
    Memory: 8.42 GB / 31.91 GB
  Binaries:
    Node: 20.17.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (129.0.2792.65)
    Internet Explorer: 11.0.19041.4355
  npmPackages:
    @clerk/clerk-sdk-node: ^5.0.50 => 5.0.58
    @clerk/express: ^1.2.3 => 1.3.7
    axios: ^1.7.7 => 1.7.7
    concurrently: ^9.0.1 => 9.0.1
    cors: ^2.8.5 => 2.8.5
    date-fns: ^4.1.0 => 4.1.0
    discord.js: ^14.0.0 => 14.16.3
    dotenv: ^10.0.0 => 10.0.0
    express: ^4.17.1 => 4.21.1
    express-rate-limit: ^7.4.1 => 7.4.1
    firebase-admin: ^12.6.0 => 12.7.0
    node-cache: ^5.1.2 => 5.1.2
    node-cron: ^3.0.3 => 3.0.3
    nodemon: ^3.1.7 => 3.1.7
wobsoriano commented 2 days ago

Hello! I'm sorry you're experiencing this issue. I just tested it locally and was able to get the correct results.

Screenshot 2024-11-04 at 11 12 33 AM

How are you using it? Could you provide a basic reproduction?

Also, I notice you're using @clerk/clerk-sdk-node. We advise migrating to @clerk/backend for pure Node projects or @clerk/express for Express projects.