You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
381 B
Go
23 lines
381 B
Go
8 months ago
|
package account
|
||
|
|
||
|
import (
|
||
|
"database/sql"
|
||
|
"fmt"
|
||
|
|
||
|
"github.com/pagefaultgames/pokerogue-server/db"
|
||
|
)
|
||
|
|
||
|
// /account/logout - log out of account
|
||
|
func Logout(token []byte) error {
|
||
|
err := db.RemoveSessionFromToken(token)
|
||
|
if err != nil {
|
||
|
if err == sql.ErrNoRows {
|
||
|
return fmt.Errorf("token not found")
|
||
|
}
|
||
|
|
||
|
return fmt.Errorf("failed to remove account session")
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|