lefthandedgoat / genit

A cross-platform website generator and server using F#, Suave and PostgreSQL.
MIT License
66 stars 10 forks source link

Fix bug in register code #60

Open lefthandedgoat opened 8 years ago

lefthandedgoat commented 8 years ago

Generator.fs

          match loginAttempt with
            | Some(loginAttempt) ->
              let returnPath = getQueryStringValue req "returnPath"
              let returnPath = if returnPath = "" then "/" else returnPath
              setAuthCookieAndRedirect id returnPath
            | None -> OK <| view_login true loginForm.Email

setAuthCookieAndRedirect is passing id the function, not the user id, use the userId on loginAttempt