質問

I am using grails 2.3.2 and spring security rc2 for authenication and able to have auto login and send confirmation email via following :

sendMail {
                from "somone@somthing.com.np"
                to params.user.username
                subject "Registration "
                body "You have register as following ID :"+institution.id+" \n" +
                        "Please click following link for verification "+
                        " \n"+baseURL+"/home/compare?code="+random+""
            }

 Authentication authentication = new UsernamePasswordAuthenticationToken(params.user.username, params.user.password);
            SecurityContextHolder.getContext().setAuthentication(authentication);

but i need message to display at each page if the user has not clicked the confirmation link and if the user has clicked the confirmation email then the message should not appear.Is there any approach to do this please help...

役に立ちましたか?

解決

Maintain conformStatus in User domain. set nullable :true.set boolean

when that url activate by the user, set true confirmationStatus in User domain.

In gsp,

<g:if test="{session.loggedInUser.confirmStatus== false}">
display like click confirmation link from your mail
</g:if>
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top