fred-123
WWasp-lang
•Created by Flictum on 7/24/2024 in #🙋questions
Translation
@martinsos is translation of the auth forms possible now?
14 replies
WWasp-lang
•Created by fred-123 on 7/1/2024 in #🙋questions
How to create a custom API Endpoint to check subscriptionStatus and subscriptionTier
Does that answer your question?
71 replies
WWasp-lang
•Created by fred-123 on 7/1/2024 in #🙋questions
How to create a custom API Endpoint to check subscriptionStatus and subscriptionTier
@kapa.ai How to secure an api endpoint in wasp 0.14 with jwt tokens?
71 replies
WWasp-lang
•Created by fred-123 on 7/1/2024 in #🙋questions
How to create a custom API Endpoint to check subscriptionStatus and subscriptionTier
just do it the proper way with JWT tokens and you should be fine
71 replies
WWasp-lang
•Created by fred-123 on 7/1/2024 in #🙋questions
How to create a custom API Endpoint to check subscriptionStatus and subscriptionTier
yeah i do.
71 replies
WWasp-lang
•Created by fred-123 on 7/1/2024 in #🙋questions
How to create a custom API Endpoint to check subscriptionStatus and subscriptionTier
At least when still building an MVP i don't think this is that relevant just yet. But of course you could make it safer and I am sure there are plenty of resources out there on a hundred ways of building it more robust.
71 replies
WWasp-lang
•Created by fred-123 on 7/1/2024 in #🙋questions
How to create a custom API Endpoint to check subscriptionStatus and subscriptionTier
why would you care if somebody else uses the endpoint?
they can only retrieve subscription status and tier if they know the email address already and that informatoin isn't really that sensitive.
71 replies
WWasp-lang
•Created by fred-123 on 7/1/2024 in #🙋questions
How to create a custom API Endpoint to check subscriptionStatus and subscriptionTier
Are you testing with postman? What errors are you getting?
Are you sure you are checking the correct db and that the user is actually present?
71 replies
WWasp-lang
•Created by fred-123 on 7/1/2024 in #🙋questions
How to create a custom API Endpoint to check subscriptionStatus and subscriptionTier
regarding the endpoint. Most likely you are working locally so it would be this for you if you use that port:
http://localhost:3001/auth/email/login
Make sure you call on port 3001 which is the server and not on 3000 which is the client
71 replies
WWasp-lang
•Created by fred-123 on 7/1/2024 in #🙋questions
How to create a custom API Endpoint to check subscriptionStatus and subscriptionTier
just share your code in a new thread and i am sure somebody will be happy to point you in the correct direction.
71 replies
WWasp-lang
•Created by fred-123 on 7/1/2024 in #🙋questions
How to create a custom API Endpoint to check subscriptionStatus and subscriptionTier
just use something like postman to test it.
71 replies
WWasp-lang
•Created by fred-123 on 7/1/2024 in #🙋questions
How to create a custom API Endpoint to check subscriptionStatus and subscriptionTier
you have to call
https://[your-server-url].fly.dev/auth/email/login
I have set up a login screen where the usere enters the email and password.
The info is then passed to the api endpoint for auth to check if it's an existing user.
In the same function that does this auth part I save the useres email address that was used to log in into the users browser storage.
That email address is then used to to check the subscription status and subscription tier:
app/src/server/api/getUserSubscriptionInfo.js
import { HttpError } from 'wasp/server';
export async function getUserSubscriptionInfo(req, res, context) {
const email = req.query.email;
console.log('Received email:', email); // Debugging line
if (!email) {
throw new HttpError(400, 'Email is required');
}
const user = await context.entities.User.findUnique({ where: { email: email } });
console.log('Queried user:', user); // Debugging line
if (!user) {
throw new HttpError(404, 'User not found');
}
const { subscriptionTier, subscriptionStatus } = user;
res.json({ subscriptionTier, subscriptionStatus });
}
Then you just do some basic conditional statements to set up the logic what the users is meant to have access to or not
71 replies
WWasp-lang
•Created by fred-123 on 7/1/2024 in #🙋questions
How to create a custom API Endpoint to check subscriptionStatus and subscriptionTier
I am not sure anymore if i had to set up a custom endpoint for it or if it was already there
71 replies
WWasp-lang
•Created by fred-123 on 7/1/2024 in #🙋questions
How to create a custom API Endpoint to check subscriptionStatus and subscriptionTier
just call the api and pass it to wherever you need it in your script
71 replies
WWasp-lang
•Created by fred-123 on 7/1/2024 in #🙋questions
How to create a custom API Endpoint to check subscriptionStatus and subscriptionTier
I am retrieving the status in the background. You can trigger it when an event is triggered that requires paid subscription.
Once the status of the user changes in the db he can't use the extension or certain features of the extension anymore depending on how you set it up. You should include two statuses. Subscription tier and payment status.
If the user hasn't paid in time his payment status will be set to past_due. Make sure your logic checks that and your good.
You can just trigger a subscription checking script after the user has logged in.
71 replies
WWasp-lang
•Created by Álvaro P. on 3/29/2024 in #🙋questions
Best Practices for Implementing Auth System in Chrome Extension Connected to OpenSaaS
61 replies
WWasp-lang
•Created by Álvaro P. on 3/29/2024 in #🙋questions
Best Practices for Implementing Auth System in Chrome Extension Connected to OpenSaaS
61 replies
WWasp-lang
•Created by Álvaro P. on 3/29/2024 in #🙋questions
Best Practices for Implementing Auth System in Chrome Extension Connected to OpenSaaS
@miho do you guys have a rough timeline when this would be implemented?
61 replies
WWasp-lang
•Created by fred-123 on 8/12/2024 in #🙋questions
Google auth not working in production
Will do!
71 replies
WWasp-lang
•Created by fred-123 on 8/12/2024 in #🙋questions
Google auth not working in production
Apreciate all the help! Without you guys i would still be stuck on that. It didn't even cross my mind that that could be the problem.
71 replies