~muirrum/gompei-verification

a2770e6db834715e3badba2362e701039fa66535 — Cara Salter 3 years ago affd4dc
Enable customizing success URL

Adds a new .env key that will contain the URL to redirect to when
someone successfully verifies.
2 files changed, 2 insertions(+), 1 deletions(-)

M README.md
M main.go
M README.md => README.md +1 -0
@@ 15,6 15,7 @@ Create a `.env` file with the following keys:
- `DISCORD_VERIFY_ROLE` - the role to be granted upon successful verification
- `DISCORD_TOKEN` - the Discord bot token
- `BASE_URL` - the base public-facing URL, used to construct redirects
- `SUCCESS_URL` - the URL to redirect to on success

## Setup
1. Create an Azure "App Registration" in [the Azure Portal](https://portal.azure.com).

M main.go => main.go +1 -1
@@ 98,7 98,7 @@ func DiscordAuth(w http.ResponseWriter, r *http.Request) {
}

func Success(w http.ResponseWriter, r *http.Request) {
	http.Redirect(w, r, "https://wpi.edu", http.StatusFound)
	http.Redirect(w, r, os.Getenv("SUCCESS_URL"), http.StatusFound)
}

func main() {