Skip to content

Commit

Permalink
Updates with some messaging on new vs old username formats
Browse files Browse the repository at this point in the history
  • Loading branch information
loganintech committed Dec 24, 2023
1 parent 35f0633 commit ce7fb2f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Coming soon! Please document any work in progress here as part of your PR. It will be moved to the next tag when released.

* Implement a Discord provider that uses `id` as the username to match against in the `whiteList` config
* Implement a Discord provider that uses Discord's updated username https://support.discord.com/hc/en-us/articles/12620128861463
* Upgrade golang to `v1.19` from `v1.18`

## v0.39.0
Expand Down
8 changes: 5 additions & 3 deletions config/config.yml_example_discord
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@

# Vouch Proxy configuration
# bare minimum to get Vouch Proxy running with OpenID Connect (such as okta)
# bare minimum to get Vouch Proxy running with Discord as an OpenID Provider

vouch:
domains:
- yourdomain.com
# whiteList is a list of user ids that will allow a login if allowAllUsers is false
# whiteList is a list of usernames that will allow a login if allowAllUsers is false
whiteList:
- 12341234123412345
- loganintech
# If the user still hasn't chosen a new username, the old username#discrimnator format will work
- LoganInTech#1203

cookie:
# allow the jwt/cookie to be set into http://yourdomain.com (defaults to true, requiring https://yourdomain.com)
Expand Down
6 changes: 4 additions & 2 deletions pkg/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,10 @@ type DiscordUser struct {
PreparedUsername string
}

// PrepareUserData copies the Username and Discriminator in the format that Discord guarantees to be unique
// https://support.discord.com/hc/en-us/articles/4407571667351-Law-Enforcement-Guidelines Subheading "How to find usernames and discriminators"
// PrepareUserData copies the Username to PreparedUsername. If the Discriminator is present that is
// appended to the Username in the format "Username#Discriminator" to match the old format of Discord usernames
// Previous format which is being phased out: https://support.discord.com/hc/en-us/articles/4407571667351-Law-Enforcement-Guidelines Subheading "How to find usernames and discriminators"
// Details about the new username requirements: https://support.discord.com/hc/en-us/articles/12620128861463
func (u *DiscordUser) PrepareUserData() {
u.PreparedUsername = u.Username
if u.Discriminator != "0" {
Expand Down

0 comments on commit ce7fb2f

Please sign in to comment.