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
Generator.fs
setAuthCookieAndRedirect is passing id the function, not the user id, use the userId on loginAttempt