ooi cat
ooi cat
Explore posts from servers
KKinde
Created by 0xJJW on 3/27/2024 in #💻┃support
GitHub Connected App Not Working
goat
36 replies
KKinde
Created by ooi cat on 3/27/2024 in #💻┃support
Reading Kinde user's discord id, if possible
Thanks!
24 replies
KKinde
Created by 0xJJW on 3/27/2024 in #💻┃support
GitHub Connected App Not Working
apparently it used to be easier to do back in the nextjs pages router era
36 replies
KKinde
Created by 0xJJW on 3/27/2024 in #💻┃support
GitHub Connected App Not Working
there is no refresh token example in auth.js docs for nextjs app router
36 replies
KKinde
Created by 0xJJW on 3/27/2024 in #💻┃support
GitHub Connected App Not Working
but I might get out of nextauth and implement JWT myself for njs14 approuter
36 replies
KKinde
Created by 0xJJW on 3/27/2024 in #💻┃support
GitHub Connected App Not Working
Got closer to solution with just basic JWT token sessions with nextauth
36 replies
KKinde
Created by 0xJJW on 3/27/2024 in #💻┃support
GitHub Connected App Not Working
@0xJJW nope. I am now working with two branches: nextAuth and Kinde
36 replies
KKinde
Created by ooi cat on 3/27/2024 in #💻┃support
Reading Kinde user's discord id, if possible
But this is off topic. Maybe I am just thinking about it all the wrong way...
24 replies
KKinde
Created by ooi cat on 3/27/2024 in #💻┃support
Reading Kinde user's discord id, if possible
Also the tokens get added the user role when they are initially issued. Not sure if this is good practice
24 replies
KKinde
Created by ooi cat on 3/27/2024 in #💻┃support
Reading Kinde user's discord id, if possible
Right now I just have Discord OAuth used with JWT tokens that expire in two weeks. If only I get the refresh tokens working it's a pretty ok solution. But Next.js 14 and jwt refresh token has seemed harder than it should be
24 replies
KKinde
Created by ooi cat on 3/27/2024 in #💻┃support
Reading Kinde user's discord id, if possible
trying another method at the moment. Basically my site needs OAuth that gates login based on either patreon/disocrd role. Then it needs some role system to check out the users role and on pages check if the user can access or not. So regardless of the methods/tech I'd want something like this: - onSignIn: allow if patreon/discord active role - some way to read the role, either from token or from where the db auth user would be stored - invalidate session once subscription ends (easier for database user/session than for a JWT session)
24 replies
KKinde
Created by 0xJJW on 3/27/2024 in #💻┃support
GitHub Connected App Not Working
thanks guys
36 replies
KKinde
Created by 0xJJW on 3/27/2024 in #💻┃support
GitHub Connected App Not Working
It probably works. It's just me... 😄
36 replies
KKinde
Created by 0xJJW on 3/27/2024 in #💻┃support
GitHub Connected App Not Working
Hey. Unfortunately I cannot now, but can try it again and see if the error occurs. I think my "kinde to application" url might have been faulty or something. The client vars seemed to work since I could accept the oauth window and it would redirect me to kinde
36 replies
KKinde
Created by 0xJJW on 3/27/2024 in #💻┃support
GitHub Connected App Not Working
Update on this? I am facing the exact same issue, but with Patreon as a Connected App
36 replies
KKinde
Created by ooi cat on 3/27/2024 in #💻┃support
Reading Kinde user's discord id, if possible
for anyone else wondering, after you set additional claims to id token, at least for discord, they are put under ext_provider Next.js SDK (app router) example:
const { getIdToken } = getKindeServerSession();
const idToken = await getIdToken();
const externalProvider = idToken.ext_provider;
console.log(externalProvider)

/* Example output:
{
"claims": {
"is_confirmed": true,
"profile": {
"accent_color": 16711680,
"avatar": "https://example.com/avatar.jpg",
"banner_color": "#00FF00",
"discriminator": "1234",
"email": "example@example.com",
"flags": 128,
"global_name": "Example User",
"id": "123456789012345678",
"locale": "en-US",
"mfa_enabled": true,
"premium_type": 1,
"public_flags": 64,
"username": "exampleuser",
"verified": true
}
}
}
*/
const { getIdToken } = getKindeServerSession();
const idToken = await getIdToken();
const externalProvider = idToken.ext_provider;
console.log(externalProvider)

/* Example output:
{
"claims": {
"is_confirmed": true,
"profile": {
"accent_color": 16711680,
"avatar": "https://example.com/avatar.jpg",
"banner_color": "#00FF00",
"discriminator": "1234",
"email": "example@example.com",
"flags": 128,
"global_name": "Example User",
"id": "123456789012345678",
"locale": "en-US",
"mfa_enabled": true,
"premium_type": 1,
"public_flags": 64,
"username": "exampleuser",
"verified": true
}
}
}
*/
24 replies
KKinde
Created by ooi cat on 3/27/2024 in #💻┃support
Reading Kinde user's discord id, if possible
@Andre @ Kinde Might not need this anymore after the Patreon Connected App access grant
24 replies
KKinde
Created by ooi cat on 3/27/2024 in #💻┃support
Reading Kinde user's discord id, if possible
just tag/dm/call
24 replies