blasphem/pkg/auth/user.go

37 lines
500 B
Go
Raw Normal View History

2022-11-12 13:34:39 -05:00
package auth
import (
"errors"
"github.com/rs/zerolog/log"
)
const (
AuthKey = "auth"
)
type User struct {
Username string
UserMetadata
}
type UserMetadata struct {
Active bool
}
func (u *User) allowedToAuth() error {
if !u.Active {
return errors.New("user disabled")
}
return nil
}
func (a *Authenticator) getOrCreateUser(c *Credential) (*User, error) {
log.Debug().Str("user", c.user.ProviderUsername()).Msg("getOrCreateUser")
panic("not implemented")
return &User{}, nil
}