Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accessing custom model records over api #1893

Closed
zlr-mounikagavara opened this issue Dec 6, 2024 · 5 comments
Closed

accessing custom model records over api #1893

zlr-mounikagavara opened this issue Dec 6, 2024 · 5 comments

Comments

@zlr-mounikagavara
Copy link

I have created custom model called repositories which would like to access rest api

@deepakprabhakara
Copy link
Member

saas-starter-kit is meant to be generic, you can use throwIfNoAccessToApiKey to guard your news added APIs.

@SindhuZelar
Copy link

saas-starter-kit is meant to be generic, you can use throwIfNoAccessToApiKey to guard your news added APIs.

Thank you for the reply ,but i need auth token to test my custom apis(POSTMAN/ThunderClient/..) which i added for my new schemas ,

@zlr-mounikagavara
Copy link
Author

Screenshot from 2024-12-08 11-14-07

@deepakprabhakara
Copy link
Member

You can create an API key once you log in, there is no auth token as such. But you are always free to extend the functionality to your liking.

@pranavig
Copy link

pranavig commented Dec 10, 2024

Hi @deepakprabhakara Thank you for the above inputs. I have a similar query.

I want one of the APIs to be also used with a postman / curl along with website session access.

If I generate the API key from login and use it with postman, its only working once. the second call throws the unauthorised error. Is there a way to generate long running tokens in this saas-starter-kit ?

Additionally, the pages/api/** files have validation for team verification like below. How does this work for postman API calls ? I don't want to comment out this code as the web application still needs this validation.

const teamMember = await throwIfNoTeamAccess(req, res);
throwIfNotAllowed(teamMember, 'team_member', 'read');

Is there any other alternative to implement this approach ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants