mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 16:17:55 +01:00
76e1c130fb
Backport #18018 When logging in the SessionID should be reset and the session cleaned up. Also logs the user in on completion of linking account Signed-off-by: Andrew Thornton <art27@cantab.net>
25 lines
621 B
Go
25 lines
621 B
Go
// Copyright 2020 The Gitea Authors. All rights reserved.
|
|
// Use of this source code is governed by a MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package session
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"gitea.com/go-chi/session"
|
|
)
|
|
|
|
// Store represents a session store
|
|
type Store interface {
|
|
Get(interface{}) interface{}
|
|
Set(interface{}, interface{}) error
|
|
Delete(interface{}) error
|
|
}
|
|
|
|
// RegenerateSession regenerates the underlying session and returns the new store
|
|
func RegenerateSession(resp http.ResponseWriter, req *http.Request) (Store, error) {
|
|
s, err := session.RegenerateSession(resp, req)
|
|
return s, err
|
|
}
|