remark42
remark42 copied to clipboard
Email confirmation with a direct link
@paskal - I think back in days we have discussed ability tо confirm by direct click from the notification email. However, this seems to be gone and confirmation email provides the token only.
Did we have a reason to drop it from the template, or just missed this part?
The reason is just separation of frontend and backend: there is a separate endpoint on the backend to verify an email but it's called from the frontend, the same way as email auth works at the moment. I'll try to figure out the possible solution for this with frontend developers, my main concern here is to keep frontend and backend decoupled (so no redirects from the backend to frontend, for example).
I see what you mean, but from another hand, email template is some sort of frontend (at least conceptually) it just happened to live in the backend universe. I don't see much a problem with adding the link generator aware of the final, UI link for this email. There are other places backend aware about such things already.
In my opinion, we can do smth like that: Frontend gives a link to a page to the backend, backend adds query param to a link. When a user goes by link, frontend catch token from a link and sends it to backend.
This solution has weak sides but it will be convenient for a user.
fine with me, good to go ;)
After #573 only frontend part left to be done (separate page to handle token submission to backend and then redirect a user back to site).
In order to enable link text in validation email, please uncomment following line of code:
https://github.com/umputun/remark/blob/f97d8232edc1ae27bf99b0dd6fefbff138905bdc/backend/app/cmd/server.go#L769-L770
By the way, now I see that there is no way to understand where redirect users to except for the main page of the site, as now we don't store where a user asked for a subscription. We can change it if it will be necessary: the frontend will tell backend where to redirect the user back, and the backend will include this information into the subscription link.