Iris Lightshard
756a0739fd
router with static files and dynamic handlers, renderers for templates, json, and xml, and beginnings of auth and cookie management
19 lines
531 B
Go
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
|
|
}
|