mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
注册帐号时,如果尚未验证,再发一次验证信 (#765)
* 注册帐号时,如果尚未验证,再发一次验证信 * 修正2个bug。 1:未验证显示密码错误 2:未验证无法重发email * 小修正,如果已存在user,拿已有user资讯取代掉新user资讯来寄送激活码 * 激活码改成激活邮件 * 忘记密码以后,重设二步验证设定 * Revert "忘记密码以后,重设二步验证设定" This reverts commit c5ac10b11c960c0a3213f3daba24a8170dc71f6a. * 實作 https://github.com/cloudreve/Cloudreve/pull/765#discussion_r584313520
This commit is contained in:
@@ -18,7 +18,7 @@ import (
|
||||
// StartLoginAuthn 开始注册WebAuthn登录
|
||||
func StartLoginAuthn(c *gin.Context) {
|
||||
userName := c.Param("username")
|
||||
expectedUser, err := model.GetUserByEmail(userName)
|
||||
expectedUser, err := model.GetActiveUserByEmail(userName)
|
||||
if err != nil {
|
||||
c.JSON(200, serializer.Err(serializer.CodeNotFound, "用户不存在", err))
|
||||
return
|
||||
@@ -52,7 +52,7 @@ func StartLoginAuthn(c *gin.Context) {
|
||||
// FinishLoginAuthn 完成注册WebAuthn登录
|
||||
func FinishLoginAuthn(c *gin.Context) {
|
||||
userName := c.Param("username")
|
||||
expectedUser, err := model.GetUserByEmail(userName)
|
||||
expectedUser, err := model.GetActiveUserByEmail(userName)
|
||||
if err != nil {
|
||||
c.JSON(200, serializer.Err(serializer.CodeCredentialInvalid, "用户邮箱或密码错误", err))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user