user
This commit is contained in:
parent
a540f94108
commit
9f39049dd6
2 changed files with 11 additions and 2 deletions
|
@ -12,6 +12,7 @@ const (
|
|||
)
|
||||
|
||||
type AuthStore interface {
|
||||
User(UserID) *User
|
||||
}
|
||||
|
||||
type authStore struct {
|
||||
|
@ -48,3 +49,7 @@ func (a *Authenticator) newAuthStore(s storage.Store) (as *authStore, err error)
|
|||
|
||||
return
|
||||
}
|
||||
|
||||
func (s *authStore) User(uid UserID) *User {
|
||||
return s.userMap[uid]
|
||||
}
|
||||
|
|
|
@ -35,6 +35,10 @@ func (u *User) allowedToAuth() error {
|
|||
|
||||
func (a *Authenticator) getOrCreateUser(c *Credential) (*User, error) {
|
||||
log.Debug().Interface("userdata", c.user.ProviderUserData()).Msg("getOrCreateUser")
|
||||
panic("not implemented")
|
||||
return &User{}, nil
|
||||
u := a.store.User(c.UserID)
|
||||
if u == nil {
|
||||
return nil, errors.New("no such user)
|
||||
}
|
||||
|
||||
return u, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue