remark42 icon indicating copy to clipboard operation
remark42 copied to clipboard

Email confirmation with a direct link

Open umputun opened this issue 4 years ago • 5 comments

@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?

umputun avatar Jan 17 '20 22:01 umputun

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).

paskal avatar Jan 17 '20 22:01 paskal

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.

umputun avatar Jan 17 '20 22:01 umputun

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.

akellbl4 avatar Jan 18 '20 08:01 akellbl4

fine with me, good to go ;)

umputun avatar Jan 18 '20 18:01 umputun

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.

paskal avatar Jan 21 '20 08:01 paskal