all: init v2 and delete old bridge

This commit is contained in:
Tulir Asokan
2024-08-15 16:43:13 +03:00
parent 64c92ca783
commit 0a7b8bf41b
87 changed files with 458 additions and 13224 deletions

29
pkg/remoteauth/user.go Normal file
View File

@@ -0,0 +1,29 @@
package remoteauth
import (
"fmt"
"strings"
)
type User struct {
UserID string
Discriminator string
AvatarHash string
Username string
Token string
}
func (u *User) update(payload string) error {
parts := strings.Split(payload, ":")
if len(parts) != 4 {
return fmt.Errorf("expected 4 parts but got %d", len(parts))
}
u.UserID = parts[0]
u.Discriminator = parts[1]
u.AvatarHash = parts[2]
u.Username = parts[3]
return nil
}