Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Render html template for account recovery

Neeraj Gupta1fb30ceafd1b
diff --git a/server/cmd/museum/main.go b/server/cmd/museum/main.go
index 5b1671619e..89d4178b3c 100644
--- a/server/cmd/museum/main.go
+++ b/server/cmd/museum/main.go
@@ -374,6 +374,8 @@ func main() {
p.ReqCntURLLabelMappingFn = urlSanitizer
server.Use(p.HandlerFunc())
+ server.LoadHTMLGlob("templates/*")
+
// note: the recover middleware must be in the last
server.Use(requestid.New(
diff --git a/server/pkg/api/user.go b/server/pkg/api/user.go
index a3cb4ec16f..abfcbeac9f 100644
--- a/server/pkg/api/user.go
+++ b/server/pkg/api/user.go
@@ -548,12 +548,14 @@ func (h *UserHandler) SelfAccountRecovery(c *gin.Context) {
}
err := h.UserController.HandleSelfAccountRecovery(c, token)
if err != nil {
- handler.Error(c, stacktrace.Propagate(err, ""))
+ logrus.WithError(err).
+ WithFields(logrus.Fields{
+ "req_id": requestid.Get(c),
+ }).Warning("Failed to handle self account recovery")
+ c.HTML(http.StatusOK, "account_recovery_error.html", gin.H{})
return
}
- c.JSON(http.StatusOK, gin.H{
- "message": "Account recovery successful",
- })
+ c.HTML(http.StatusOK, "account_recovered.html", gin.H{})
}
// GetSRPAttributes returns the SRP attributes for a user