quartzgun/auth/auth.go
Iris Lightshard 756a0739fd
initial commit
router with static files and dynamic handlers, renderers for templates, json, and xml, and beginnings of auth and cookie management
2022-01-04 13:23:25 -07:00

19 lines
531 B
Go

package auth
import (
//nilfm.cc/git/goldbug/cookie
)
type UserStore interface {
InitiateSession(user string, sessionId string) error
ValidateUser(user string, password string, sessionId string) (bool, error)
EndSession(user string) error
}
func Login(user string, password string, userStore UserStore) (string, error) {
//ValidateUser (check user exists, hash and compare password)
//InitiateUserSession (generate token and assign it to the user)
//set username in cookie
//return token, nil
return "", nil
}