logout button
This commit is contained in:
parent
028c023f80
commit
022619246e
5 changed files with 32 additions and 1 deletions
|
|
@ -12,6 +12,12 @@ func (s *Store) AddSession(token, userName string, expiration time.Time) error {
|
|||
return err
|
||||
}
|
||||
|
||||
func (s *Store) RevokeSession(token string) error {
|
||||
query := "delete from session where token = ?;"
|
||||
_, err := s.db.Exec(query, token)
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *Store) CleanSessions() error {
|
||||
now := time.Now().Format("2006-01-02 15:04")
|
||||
query := "delete from session where expiration < ?;"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue