Shampurrrs
Shampurrrs
Explore posts from servers
KKinde
Created by Shampurrrs on 11/19/2024 in #💻┃support
undefined access_token when using session manager with typescript SDK
Hi Sam. if I run this code where I am logging the result of the session. my session is undefined, then has a result then becomes undefined again.
getSessionItem undefined
getSessionItem 95b005908e6beb10ddc10e51628e
getSessionItem undefined
getSessionItem undefined
getSessionItem 95b005908e6beb10ddc10e51628e
getSessionItem undefined
I am using Hono for the cookie functions, maybe Kinde is just not meant to work with Hono?
export const sessionManager = (c: Context): SessionManager => ({
async getSessionItem(key: string) {
const result = getCookie(c, key);
console.log("getSessionItem", result);
return result;
},
async setSessionItem(key: string, value: unknown) {
const cookieOptions = {
httpOnly: true,
secure: true,
sameSite: "Lax",
} as const;
if (typeof value === "string") {
setCookie(c, key, value, cookieOptions);
} else {
setCookie(c, key, JSON.stringify(value), cookieOptions);
}
},
async removeSessionItem(key: string) {
deleteCookie(c, key);
},
async destroySession() {
["id_token", "access_token", "user", "refresh_token"].forEach((key) => {
deleteCookie(c, key);
});
},
});
export const sessionManager = (c: Context): SessionManager => ({
async getSessionItem(key: string) {
const result = getCookie(c, key);
console.log("getSessionItem", result);
return result;
},
async setSessionItem(key: string, value: unknown) {
const cookieOptions = {
httpOnly: true,
secure: true,
sameSite: "Lax",
} as const;
if (typeof value === "string") {
setCookie(c, key, value, cookieOptions);
} else {
setCookie(c, key, JSON.stringify(value), cookieOptions);
}
},
async removeSessionItem(key: string) {
deleteCookie(c, key);
},
async destroySession() {
["id_token", "access_token", "user", "refresh_token"].forEach((key) => {
deleteCookie(c, key);
});
},
});
6 replies
KKinde
Created by Shampurrrs on 11/19/2024 in #💻┃support
undefined access_token when using session manager with typescript SDK
Hi! It's just the generic responses that mimic the documentation I have looked at, it's telling me things I already know and it feels like i't not worth the time to give support. Too be fair I am using a free plan currently and I am not a very good dev, so maybe it isn't worth supports time. Cheers.
6 replies
KKinde
Created by Shampurrrs on 11/19/2024 in #💻┃support
undefined access_token when using session manager with typescript SDK
yeah! Unfortunately I'm going to have to move away from Kinde as it is too faulty and teh support is lacking. Thanks for your reply though.
6 replies
TTCTheo's Typesafe Cult
Created by Shampurrrs on 9/23/2023 in #questions
CreateTRPCNext<AppRouter> showing typescript error.
4 replies
TTCTheo's Typesafe Cult
Created by Shampurrrs on 10/19/2022 in #questions
How to handle cancelled login, when using nextAuth OAuth?
OK! I've managed to get rid of that callback page, It now redirects to the login page on OAuth cancellation. I do however have this URL when redirected
http://localhost:3000/logincallbackUrl=http%3A%2F%2Flocalhost%3A3000%2F&error=Callback
http://localhost:3000/logincallbackUrl=http%3A%2F%2Flocalhost%3A3000%2F&error=Callback
I don't think it's that big of a deal though. Thanks for your help!! Really appreciate it. @Piotrek
12 replies
TTCTheo's Typesafe Cult
Created by Shampurrrs on 10/19/2022 in #questions
How to handle cancelled login, when using nextAuth OAuth?
Sorry! I missed you. I live in NZ so our timezones might be a bit wack.
12 replies
TTCTheo's Typesafe Cult
Created by Shampurrrs on 10/19/2022 in #questions
How to handle cancelled login, when using nextAuth OAuth?
Hi @Piotrek Could I have more context. sorry if i'm being annoying. I have a button, that has an onClick eventHandler attached to it a button
onClick={() =>signIn("discord", { callbackUrl:"http://localhost:3000/"})}
onClick={() =>signIn("discord", { callbackUrl:"http://localhost:3000/"})}
would I add the error param here?
12 replies
TTCTheo's Typesafe Cult
Created by Shampurrrs on 10/19/2022 in #questions
How to handle cancelled login, when using nextAuth OAuth?
Hi @Piotrek Thanks for reply. Would I do this in the [...nextauth] file, in the callback object?
12 replies