Project

General

Profile

Redirect from a link, token sent by email (Wt::Auth)

Added by Paweł Grodowski about 4 years ago

Please help,

I am at the stage of learning (reading documentation) the WebToolkit C engine. However, I have a big problem because I can't redirect the link with the confirmation token correctly.

For the purposes of testing the Wt library as well as debugging I use.

The Linux Slackware operating system, I really like the documentation for rebuilding the "Wt" library with a port for just Slackware.

I also configured the Apache server with the https protocol with the "rewrite_mod" module

Dovecot mail server with Postfix only with TLS.

Very well Wt (WebToolKit) adopts this environment.

Link emails are sent using the registration window from Wt::Auth and the whole frame works fine.

example:

Hello P10000,

Thank you for joining!

To complete your registration, please finally confirm your account by clicking on the following link or copying the URL into your browser.

Please click here to confirm your registration or copy and paste the following URL into your browser: (Note: be sure to copy the entire URL, including any part of it which goes onto a second line.)

http://wt.onion.lan/helptext/helptext.wt/auth/mail/A6rvahNeFPIF5RskIaMhEPj2gX2KoVy9

Note to developer:

This text is resolved from the "Wt.Auth.confirmmail.subject", "Wt.Auth.confirmmail.body", and "Wt.Auth.confirmmail.htmlbody" resource keys.

Good luck with your Wt application,

The wt team.

I only change:

*http://*wt.onion.lan/helptext/helptext.wt/auth/mail/A6rvahNeFPIF5RskIaMhEPj2gX2KoVy9

on:

*https://*wt.onion.lan/helptext/helptext.wt/auth/mail/A6rvahNeFPIF5RskIaMhEPj2gX2KoVy9

to adapt the link from http: // to https: // (protocol)

Here, if I can, I would like to ask about how to quickly change the link generation from http: // to https: //.

I can redirect with "rewirte_mod" from http to https.

Returning to the problem, I do not know how to redirect the URL correctly:

auth/email/A6rvahNeFPIF5RskIaMhEPj2gX2KoVy9

to later function:

internalPath() returned correctly the entry to: AuthService::parseEmailToken.

in order to redirect (although I don't know if it should look like this), I use the mechanism with the input file: .htaccess

where I redirect:

RewriteRule helptext/root/debug/bin/helptext.wt/auth/mail/.+$ https://wt.onion.lan/helptext/helptext.wt/ [R, L]

and this is where my problem begins.

Is there part of the documentation that would explain how to (if necessary) redirect this URL:

auth/email/A6rvahNeFPIF5RskIaMhEPj2gX2KoVy9

internally so as to initiate the wt environment correctly and register the user properly.

I also attach files from the virtual host for Wt WebToolKit and the file: .htaccess

.

Thank you in advance to the entire emweb.be team.


Replies (1)

RE: Redirect from a link, token sent by email (Wt::Auth) - Added by Roel Standaert about 4 years ago

I see you're using wtfcgi. Wt should normally set the URL to start with https if the HTTPS environment variable is set to ON, which should be something that Apache does automatically. Is the TLS being terminated by Apache, or by some proxy in front of Apache?

I don't know about the mod_rewrite stuff. I believe if you're using mod_rewrite you should at least use variables to keep some of the URL? But I don't know if that should even be necessary here. If the client never goes to helptext/root/debug/bin/helptext.wt/..., then the rewrite rule doesn't do anything anyway.

    (1-1/1)