next-auth.session-token disparity
Unanswered
Cinnamon posted this in #help-forum
CinnamonOP
Using Next auth, I login to an external API. I receive this token:
token Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ1c2Vycy1zZXJ2aWNlIiwic3ViIjoiMSIsInJvbGUiOiJST0xFX1VTRVIiLCJleHAiOjE3MjA0MTQ3NTN9.P8s_qFjKM29ttwgnhW9EOEjsL-AmLOgzdqSV_Xn9QI4 In my [...nextauth].ts file I add my token to the user.accessToken in the authorize function like this: const token = res.headers.get("Authorization");
const user = await res.json();
user.accessToken = token; I don't know if next-auth uses the accessToken to set up the session-token. But when I look at the cookie next-auth.session-token, I see a different token eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0..zBCx5yzAcDplQTEO.EbbEZcdgF7rKeYvTXC20SJTrU3HdVVOtBpQrtVoENEcwDAkjRiEhaDij0G5D4j076G2gOQALqqNJ5ohDWjRV-CzGdmtDuo0smIu_luAEPuJtQLWrMRg-iz4RKecl385f0bHvfYjDW_umwZ8qJ35VgLBk33YwwRG-S_XgUpsnFvsImsueC_HgqDXeA_NznZt_r8cwpC54osg5Z3BN0Osm9qNrmx9bnIylwhgbXsGLrhgtInarbxd4BcpVnRX7U6ePh3piOoH_L1F7tl9qRGJoMezChv0xaPUVaP-WAnPSr9jUvQ1lcT8BMAwQopbogNeQ2rj10Dd81VPc_TWretae5O5JwvcUwnHQ21qjpStCEvPDC0QHhg6bHZ3wxWrXHF-s-GE7eUswppmvQGKTdhcV9h0eb8YxMRcl9Kp61F4ussgc9FrJ2-JFC8O5aoGr-spJP2BuXe7Pn-dGePScZ8JaHrjBFw.FrvSh8pKtAMmorPcyrxCnw Can someone explain why ?