Grails4安全ui插件发送验证邮件,但不解锁用户

h7appiyu  于 2021-06-27  发布在  Java
关注(0)|答案(0)|浏览(171)

我试图让我的用户在我的postgresql数据库中解锁,使用grails、security core、security ui和mail的标准电子邮件验证。
每当我单击电子邮件中的验证链接时,它就会按照默认的注册后重定向将我带到应用程序的grails主页,但它没有让我登录,也没有更新我用于持久化的postgres数据库。
我想我的主要问题是,验证邮件中的链接做了什么,我能做些什么导致这个问题?
这是我的用户类:

package com.anjg

import groovy.transform.EqualsAndHashCode
import groovy.transform.ToString
import grails.compiler.GrailsCompileStatic

@GrailsCompileStatic
@EqualsAndHashCode(includes='username')
@ToString(includes='username', includeNames=true, includePackage=false)
class User implements Serializable {

    private static final long serialVersionUID = 1

    String username
    String password
    String email
    boolean enabled = true
    boolean accountExpired
    boolean accountLocked
    boolean passwordExpired

    Set<Role> getAuthorities() {
        (UserRole.findAllByUser(this) as List<UserRole>)*.role as Set<Role>
    }

    static constraints = {
        password nullable: false, blank: false, password: true
        username nullable: false, blank: false, unique: true
        email email: true, blank: false, unique: true
    }

    static mapping = {
        table 'Users'
        password column: '`password`'
    }
}

以防我在向这个域类添加电子邮件时做了傻事?
谢谢你的帮助
编辑:所以我确保发送的令牌与电子邮件中发送的url相匹配,确实如此。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题