moggelitalanya
Explore posts from serversKKinde
•Created by moggelitalanya on 12/18/2024 in #💻┃support
NextJS API endpoint - verify token
Hello,
First off, im currently studying front-end development, take this as a warning as this might be a "noob" question!
Im currently setting up my API for my NextJs application, using kinde as authentication.
As ive developed this i have used NextJS server-actions to check authentication for user and checked the role.
Now that im trying to implement this on the API route endpoints (/api) i can no longer check the auth status with "getKindeServerSession", im not really sure why but if I for example try getUser im getting "null".
As this issue showed up i have tried looking other ways for authenticate.
I have set up the SDK for management API on my NextJS API but have not really found any solution.
I have noticed that my requests to the API does not include any "cookie", for a token to check. Im thinking that the middleware used with NextJS + kindeauth is messing this up as the matcher is exluding "api" routes.
Hopefully this is very easy for someone to explain, appreciate the support, thanks in advance!
13 replies
KKinde
•Created by moggelitalanya on 12/5/2024 in #💻┃support
React Native - expo
Hello!
Im using Kinde within a React Native- expo project, I already built a NextJS application using Kinde, which works like a charm.
When trying to build something similar in react native with the fitting SDK im seeing a issue right away, when using "getUserDetails" im not getting the set username of the logged in user.
Ive checked the token-settings but have not found anything regarding enabling it to be within the object recieved from "getUserDetails".
Any solution to this?
Thanks in advance 🙂
6 replies
KKinde
•Created by moggelitalanya on 11/22/2024 in #💻┃support
Get current user role
Hello!
Im using NextJS 15 with Kinde auth (love it so far)
I have been looking through older posts about how to get the current users role, but I have not yet succeeded to find a solution.
My goal is to get the role when fetching "getUser" through "getKindeServerSession".
I have made sure to create desired roles and assigned them.
Maybe i have not really understood the concept of how to use roles properly in Kinde Auth, im currently studying front-end dev so sorry if the answer is rather simple 🙂
Thanks in advance!
EDIT / ADDITION:
While reading the documentation i see that Kinde recommend controlling access to features on permission-level -> We recommend you use permissions for controlling access to features within your application, then use roles to group the permissions.
But for interest i still would like to know if above is possible.
5 replies