// NewLogoutUser creates a new http.Handler for the logout user operation
340997
func NewLogoutUser(ctx *middleware.Context, handler LogoutUserHandler) *LogoutUser {
	return &LogoutUser{Context: ctx, Handler: handler}
}
1116352
func (c *LogoutController) Logout(ctx *app.LogoutLogoutContext) error {
	return redirectWithParams(ctx, c.configuration, ctx.ResponseData.Header(), ctx.Params, authservice.LogoutLogoutPath())
}
214850
func (c *LogoutController) Logout(ctx *app.LogoutLogoutContext) error {
	logoutRedirect, err := c.doLogout(ctx, ctx.Redirect, ctx.Referer)
	if err != nil {
		return err
	}

	ctx.ResponseData.Header().Set("Cache-Control", "no-cache")
	ctx.ResponseData.Header().Set("Location", logoutRedirect)
	return ctx.TemporaryRedirect()
}
838284
func NewHandler(log zerolog.Logger) func(http.Handler) http.Handler {
	return func(next http.Handler) http.Handler {
		return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
			// Create a copy of the logger (including internal context slice)
			// to prevent data race when using UpdateContext.
			l := log.With().Logger()
			r = r.WithContext(l.WithContext(r.Context()))
			next.ServeHTTP(w, r)
		})
	}
}
462004
func (m UsersAPIAuthMethod) LogoutURL(c context.Context, dest string) (string, error) {
	return user.LogoutURL(c, dest)
}
1101641
func (m *AuthMethod) logoutHandler(ctx *router.Context) {
	c, rw, r := ctx.Context, ctx.Writer, ctx.Request

	dest, err := normalizeURL(r.URL.Query().Get("r"))
	if err != nil {
		replyError(c, rw, err, "Bad redirect URI (%q) - %s", dest, err)
		return
	}

	// Close a session if there's one.
	sid, err := decodeSessionCookie(c, r)
	if err != nil {
		replyError(c, rw, err, "Error when decoding session cookie - %s", err)
		return
	}
	if sid != "" {
		(logging.Fields{"sid": sid}).Infof(c, "Closing the session")
		if err = m.SessionStore.CloseSession(c, sid); err != nil {
			replyError(c, rw, err, "Error when closing the session - %s", err)
			return
		}
	}

	// Nuke all session cookies to get to a completely clean state.
	removeCookie(rw, r, sessionCookieName)
	m.removeIncompatibleCookies(rw, r)

	// Redirect to the final destination.
	logging.Infof(c, "Redirecting to %s", dest)
	http.Redirect(rw, r, dest, http.StatusFound)
}
451019
func NewUserHandler() *UserHandler {
	h := &UserHandler{
		Router: NewRouter(),
	}

	h.HandlerFunc("POST", usersPath, h.handlePostUser)
	h.HandlerFunc("GET", usersPath, h.handleGetUsers)
	h.HandlerFunc("GET", usersIDPath, h.handleGetUser)
	h.HandlerFunc("GET", usersLogPath, h.handleGetUserLog)
	h.HandlerFunc("PATCH", usersIDPath, h.handlePatchUser)
	h.HandlerFunc("DELETE", usersIDPath, h.handleDeleteUser)
	h.HandlerFunc("PUT", usersPasswordPath, h.handlePutUserPassword)

	h.HandlerFunc("GET", mePath, h.handleGetMe)
	h.HandlerFunc("PUT", mePasswordPath, h.handlePutUserPassword)

	return h
}
89099
func NewUserOperationLogService() *UserOperationLogService {
	return &UserOperationLogService{
		GetUserOperationLogFn: func(context.Context, platform.ID, platform.FindOptions) ([]*platform.OperationLogEntry, int, error) {
			return nil, 0, nil
		},
	}
}
350868
func NewCreateUser(ctx *middleware.Context, handler CreateUserHandler) *CreateUser {
	return &CreateUser{Context: ctx, Handler: handler}
}
126641
func (c *Client) NewLogger() (*Logger, error) {
	log := newLogger()
	log.client = c

	return log, nil
}
902858
func restLogout(w *rest.ResponseWriter, r *rest.Request) {
	glog.V(2).Info("restLogout() called.")
	// Read session cookie and delete session
	cookie, err := r.Request.Cookie(sessionCookie)
	if err != nil {
		glog.V(2).Info("Unable to read session cookie")
	} else {
		deleteSessionT(cookie.Value)
		glog.V(2).Infof("Deleted session %s for explicit logout", cookie.Value)
	}

	// Blank out all login cookies
	writeBlankCookie(w, r, auth0TokenCookie)
	writeBlankCookie(w, r, sessionCookie)
	writeBlankCookie(w, r, usernameCookie)
	w.WriteJson(&simpleResponse{"Logged out", loginLink()})
}
96680
func myHandler(w http.ResponseWriter, r *http.Request) {
	m := map[string]interface{}{}

	sess := session.Get(r)
	if sess != nil {
		// Already logged in
		if r.FormValue("Logout") != "" {
			session.Remove(sess, w) // Logout user
			sess = nil
		} else {
			sess.SetAttr("Count", sess.Attr("Count").(int)+1)
		}
	} else {
		// Not logged in
		if r.FormValue("Login") != "" {
			if userName := r.FormValue("UserName"); userName != "" && r.FormValue("Password") == "a" {
				// Successful login. New session with initial constant and variable attributes:
				sess = session.NewSessionOptions(&session.SessOptions{
					CAttrs: map[string]interface{}{"UserName": userName},
					Attrs:  map[string]interface{}{"Count": 1},
				})
				session.Add(sess, w)
			} else {
				m["InvalidLogin"] = true
			}
		}
	}

	if sess != nil {
		m["UserName"] = sess.CAttr("UserName")
		m["Count"] = sess.Attr("Count")
	}

	if err := templ.Execute(w, m); err != nil {
		log.Println("Error:", err)
	}
}
1328632
func (s *UpdateUserPoolClientInput) SetLogoutURLs(v []*string) *UpdateUserPoolClientInput {
	s.LogoutURLs = v
	return s
}
1201550
func Logout() error {
	if err := client.Delete(); err != nil {
		return err
	}

	fmt.Println("Logged out")
	return nil
}
350017
func (c *UserController) AnyLogout() {
	if c.isLoggedIn() {
		c.logout()
	}

	c.Ctx.Redirect("/user/login")
}
742473
func (cl *CoLog) NewLogger() *log.Logger {
	cl.mu.Lock()
	defer cl.mu.Unlock()

	return log.New(cl, "", 0)
}
92857
func NewHandler(c Config) func(http.Handler) http.Handler {
	if c.Output == nil {
		c.Output = NewOutputChannel(NewConsoleOutput())
	}
	return func(next http.Handler) http.Handler {
		return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
			var l Logger
			if r != nil {
				l = New(c)
				r = r.WithContext(NewContext(r.Context(), l))
			}
			next.ServeHTTP(w, r)
			if l, ok := l.(*logger); ok {
				l.close()
			}
		})
	}
}