コード例 #1
13
ファイル: auth.go プロジェクト: hobo-c/gin_sample
// Logout will clear out the session and call the Logout() user function.
func Logout(s sessions.Session, user User) {
	user.Logout()
	s.Delete(SessionKey)
	s.Save()
}
コード例 #2
0
ファイル: auth.go プロジェクト: hobo-c/gin_sample
func (a auth) LogoutTest(s sessions.Session) {
	a.User.Logout()
	s.Delete(SessionKey)
	s.Save()
}
コード例 #3
0
ファイル: auth.go プロジェクト: hobo-c/gin_sample
// UpdateUser updates the User object stored in the session. This is useful incase a change
// is made to the user model that needs to persist across requests.
func UpdateUser(s sessions.Session, user User) error {
	s.Set(SessionKey, user.UniqueId())
	s.Save()
	return nil
}