namsral / multipass

Better authentication for HTTP
BSD 3-Clause "New" or "Revised" License
73 stars 4 forks source link

Sorry, your CSRF token is invalid #22

Open yatr98 opened 7 years ago

yatr98 commented 7 years ago

Hello,

I am new to caddy and am trying to test out multipass. When I go to localhost:8081/multipass, I get the multipass submit screen to submit in my handle. When I type in the email address that I specified in handles line of the Caddyfile, I get the error,

Sorry, your CSRF token is invalid

Here is my Caddyfile:

localhost:8081 {

bind 127.0.0.1
tls off
root /home/marc/CaddyServer

errors {
    log error.log
    }

fastcgi / 127.0.0.1:9000 {
        ext  .php
    }

multipass {
    resources /forms
    handles joe@example.com
    basepath /multipass
    expires 24h
    smtp_server smtp.gmail.com:  <--- (tried both 465 and 587)
    smtp_user user1@gmail.com
    smtp_pass 123456
    mail_from "Multipass <user1@gmail.com>"
}
log stdout
}

I have tried using both smtp_client and smtp_server formats and they both give the same result.

What am I doing wrong? Could you point me in the right direction on how to proceed?

Thank you,

Marc

suhlig commented 6 years ago

I had the same issue and found that it was due to my dev server running without TLS (tls off in the config file).

I solved it by setting the environment variable MULTIPASS_DEV to true. This is evaluated in multipass.go#L157.