added stuff, broke some other stuff, made admin auth!
Signed-off-by: ari melody <ari@arimelody.me>
This commit is contained in:
parent
0d1e694b59
commit
5631c4bd87
26 changed files with 1615 additions and 1401 deletions
44
discord/discord.go
Normal file
44
discord/discord.go
Normal file
|
@ -0,0 +1,44 @@
|
|||
package discord
|
||||
|
||||
const API_ENDPOINT = "https://discord.com/api/v10"
|
||||
const CLIENT_ID = "1268013769578119208"
|
||||
// TODO: good GOD change this later please i beg you. we've already broken
|
||||
// the rules by doing this at all
|
||||
const CLIENT_SECRET = "JUEZnixhN7BxmLIHmbECiKETMP85VT0E"
|
||||
const REDIRECT_URI = "https://discord.com/oauth2/authorize?client_id=1268013769578119208&response_type=code&redirect_uri=http%3A%2F%2F127.0.0.1%3A8080%2Fapi%2Fv1%2Fadmin%2Flogin&scope=identify"
|
||||
// TODO: change before prod
|
||||
const MY_REDIRECT_URI = "http://127.0.0.1:8080/api/v1/admin/login"
|
||||
|
||||
type (
|
||||
AccessTokenResponse struct {
|
||||
TokenType string `json:"token_type"`
|
||||
AccessToken string `json:"access_token"`
|
||||
ExpiresIn int `json:"expires_in"`
|
||||
RefreshToken string `json:"refresh_token"`
|
||||
Scope string `json:"scope"`
|
||||
}
|
||||
|
||||
AuthInfoResponse struct {
|
||||
Application struct {
|
||||
Id string
|
||||
Name string
|
||||
Icon string
|
||||
Description string
|
||||
Hook bool
|
||||
BotPublic bool
|
||||
botRequireCodeGrant bool
|
||||
VerifyKey bool
|
||||
}
|
||||
Scopes []string
|
||||
Expires string
|
||||
User struct {
|
||||
Id string
|
||||
Username string
|
||||
Avatar string
|
||||
Discriminator string
|
||||
GlobalName string
|
||||
PublicFlags int
|
||||
}
|
||||
}
|
||||
)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue