WIP; implements email confirmation but login results in a redirect loop