This repository has been archived by the owner on Jan 24, 2021. It is now read-only.
FormsAuthentication Login/logout methods assume configuration is not null #1755
Labels
Milestone
The (public) methods to
Nancy.Authentication.Forms.FormsAuthentication
login and logout methods, e.g.UserLoggedInRedirectResponse(..)
orLogOutAndRedirectResponse(...)
assume that theFormsAuthenticationConfiguration currentConfiguration
has been set by theEnable
method.However, if it's not, then
BuildCookie
throws aNullReferenceException
at runtime, with no explanation of what's wrong. It's taken me about an hour to track down that I'm returning from the bootstrapperRequestStartup
before setting the forms configuration. It's a silly mistake, but easy to make.Would there be an objection to adding a guard on these methods, something like:
The text was updated successfully, but these errors were encountered: