Using/ Calling Default 'Email Verification' template and using SMTP settings setup in Admin Dashboard? #2895
|
I am self-hosting PB on digitalocean's droplet, and I've setup the custom action URL, modified the default mail templates, and also setup my SMTP server settings. However, I wish to use my go backend to call these methods (basically to connect via pocketbase.NewClient with my admin credentials before calling required methods) , but I can't seem to find the correct method for this. Do I follow https://pocketbase.io/docs/sending-emails/#overwrite-system-emails or use event hooks? I |
Replies: 2 comments 6 replies
|
I'm not sure that I understand the question. Are you using PocketBase as framework OR interacting with PocketBase from another Go application using the unofficial go client sdk (because we don't have The docs link in your post works only if you use PocketBase as framewok. If you are interacting with PocketBase from external application via the web APIs, then you can check https://pocketbase.io/docs/api-records/#auth-record-actions and the "Request verification" call (but I'm not sure if this method is supported by the unofficial go client). |
|
Thank you, and yes I meant ' interacting with PocketBase from external application via the web APIs'. Thank you for pointing me to the right direction. I managed to resolve it by using a direct http request with admin token instead. I would like to seek your knowledge on two points:
POST /api/collections/pb_users_auth/confirm-verification to my pocketbase server. How do i manage it such that it works to only allow 'Verify' once - after that when users presses on it it does not send POST to my api server?
I am asking because I am planning on using admin tokens as a variable for my new users to send out requestverifications, and i wish to render each token invalid upon confirmation of email verification. I guess I won't really have a need for the 'Invalidate all previously issued tokens' option, but was just curious. |
Users can always send requests to your server and responding with an error is no different then a success response, aka. at the end the request already reached the server.
Users can spam your server by just sending request to the health api. If you are concerned about DDoS, then this needs to be handled on a different level (ideally before even reaching your server).