如何在JHipster中禁用新用户电子邮件激活?

时间:2017-09-18 16:02:54

标签: jhipster

关于新用户注册, 我试过设置

    private boolean activated = true;

但这没有帮助。

如何在JHipster中禁用新用户电子邮件激活?

2 个答案:

答案 0 :(得分:2)

修改UserService.createUser()并更改以下行:

    // new user is not active
    newUser.setActivated(false);
    // new user gets registration key
    newUser.setActivationKey(RandomUtil.generateActivationKey());

activateRegistration()中完成的工作:

    // activate given user
    newUser.setActivated(true);
    newUser.setActivationKey(null);

当然,删除发送激活电子邮件的行:

   mailService.sendActivationEmail(user);

答案 1 :(得分:0)

同样可以通过插入

来实现
test = []
response = []
time =[]

with open("textfile.txt",'r') as txt_file:
    for line in txt_file.readlines():
        if ("testings") in line:
            test.append(line.strip())    
        if ("response") in line:
            response.append(line.strip())
        if ("time") in line:
            time.append(line.strip())


print (response)
print (test)
print (time)

之前

    // auto-activate newUser
    this.activateRegistration(newUser.getActivationKey());

进入 return newUser;

当然UserService.createUser()中的registerAccount()仍需要更改:

AccountResource