-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simple ui works with link now, auth not uses cookies
- Loading branch information
Showing
10 changed files
with
113 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="refresh" content="0; URL={{.RedirectUrl}}" /> | ||
<title>Redirecting...</title> | ||
<style> | ||
body { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
background-color: #f5f5f5; | ||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; | ||
font-size: 14px; | ||
line-height: 1.42857143; | ||
color: #333; | ||
} | ||
|
||
h1 { | ||
font-size: 3rem; | ||
margin-top: 20px; | ||
margin-bottom: 10px; | ||
} | ||
|
||
button { | ||
margin-top: 10px; | ||
height: 3rem; | ||
width: 10rem; | ||
font-size: 1rem; | ||
color: #333; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>Not Redirecting?</h1> | ||
<p>Click the button below to open the link in the web app instead.</p> | ||
<button onclick="window.location.href='/static/simpleui';"><b>Open In Web App Instead</b></button> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package commands | ||
|
||
import ( | ||
"esefexapi/userdb" | ||
|
||
"github.com/bwmarrin/discordgo" | ||
) | ||
|
||
var ( | ||
UnlinkCommand = &discordgo.ApplicationCommand{ | ||
Name: "unlink", | ||
Description: "Unlink your Discord account from Esefex. Useful if you think your account has been compromised.", | ||
} | ||
) | ||
|
||
func (c *CommandHandlers) Unlink(s *discordgo.Session, i *discordgo.InteractionCreate) (*discordgo.InteractionResponse, error) { | ||
c.dbs.UserDB.DeleteUser(i.Member.User.ID) | ||
c.dbs.UserDB.SetUser(userdb.User{ | ||
ID: i.Member.User.ID, | ||
Tokens: []userdb.Token{}, | ||
}) | ||
|
||
return &discordgo.InteractionResponse{ | ||
Type: discordgo.InteractionResponseChannelMessageWithSource, | ||
Data: &discordgo.InteractionResponseData{ | ||
Content: "Your account has been unlinked from Esefex. You can now link your account again.", | ||
}, | ||
}, nil | ||
} |