Core functionality for new aiterp.net servers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
717 B

package auth
type User struct {
ID string `json:"id"`
Level string `json:"level"`
Data map[string]string `json:"data"`
method Authenticator
loggedOut bool
}
// FullID is the userid prefixed with the method ID
func (user *User) FullID() string {
return user.method.ID() + ":" + user.ID
}
// Logout flags the user for logout
func (user *User) Logout() {
user.loggedOut = true
}
// LoggedOut returns whether the Logout() function has been called
func (user *User) LoggedOut() bool {
return user.loggedOut
}
// NewUser creates a new User object
func NewUser(method Authenticator, id, level string, data map[string]string) *User {
return &User{id, level, data, method, false}
}