Browse Source

Only show auth message if name changed

pull/2647/head
Gabe Kangas 3 years ago
parent
commit
049a9d0080
No known key found for this signature in database
GPG Key ID: 4345B2060657F330
  1. 2
      controllers/auth/fediverse/fediverse.go
  2. 2
      controllers/auth/indieauth/client.go

2
controllers/auth/fediverse/fediverse.go

@ -79,10 +79,12 @@ func VerifyFediverseOTPRequest(w http.ResponseWriter, r *http.Request) { @@ -79,10 +79,12 @@ func VerifyFediverseOTPRequest(w http.ResponseWriter, r *http.Request) {
return
}
if authRegistration.UserDisplayName != u.DisplayName {
loginMessage := fmt.Sprintf("**%s** is now authenticated as **%s**", authRegistration.UserDisplayName, u.DisplayName)
if err := chat.SendSystemAction(loginMessage, true); err != nil {
log.Errorln(err)
}
}
controllers.WriteSimpleResponse(w, true, "")

2
controllers/auth/indieauth/client.go

@ -76,10 +76,12 @@ func HandleRedirect(w http.ResponseWriter, r *http.Request) { @@ -76,10 +76,12 @@ func HandleRedirect(w http.ResponseWriter, r *http.Request) {
return
}
if request.DisplayName != u.DisplayName {
loginMessage := fmt.Sprintf("**%s** is now authenticated as **%s**", request.DisplayName, u.DisplayName)
if err := chat.SendSystemAction(loginMessage, true); err != nil {
log.Errorln(err)
}
}
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)

Loading…
Cancel
Save