Unverified Commit 052d3cc6 authored by Kevin Di Lallo's avatar Kevin Di Lallo Committed by GitHub
Browse files

Merge pull request #107 from dilallkx/kd_sp27_fix_cookie

Login session cookie fix on microservice restart
parents d2bd7eb7 40de0730
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -100,14 +100,10 @@ func uaLoginUser(w http.ResponseWriter, r *http.Request) {
	session, err := CookieStore.Get(r, "authCookie")
	if err != nil {
		log.Info(err.Error())
		// Patch until encryption keys are persisted
		// Try to renew the cookie
		if session != nil {
			session, err = CookieStore.New(r, "authCookie")
			if err != nil {
				http.Error(w, err.Error(), http.StatusInternalServerError)
			}
		} else {
		// Cookie decryption may fail on microservice restart due to
		// mismatch with newly created cookie store encryption keys (no persistence).
		// In this case use the newly generated session, if successfully created.
		if session == nil {
			http.Error(w, err.Error(), http.StatusInternalServerError)
			return
		}