sharedutils/sharedauth/sharedauth.go
2023-03-13 13:38:16 +03:00

52 lines
979 B
Go

package sharedauth
import (
"time"
)
type InstallIdRegisterReq struct {
InstallId InstallId
}
type InstallId string
func (id InstallId) Validate() bool {
//TODO: More checks
return id != ""
}
type RedirResp struct {
RedirectUrl string `json:"redirecturl"`
}
type LauncherSession struct {
// Username string
// DiscordId string
SessionToken string
InstallId string
Expiry time.Time
}
type ProfileResp struct {
Username string
}
type ValidateReq struct {
LauncherToken string
}
type ValidateResp struct {
}
type SkirdaUser struct {
SkirdaUserId string `bson:"skirdauserid" json:"skirdauserid"`
DiscordId string `bson:"discordid" json:"-"`
Username string `bson:"username" json:"username"`
UserDomains []string `bson:"userdomains" json:"userdomains"`
Installs []LauncherInstall `bson:"installs" json:"-"`
}
type LauncherInstall struct {
InstallId string `bson:"installid"`
}