Custom verifyEmail template in User Accounts

Hi

I installed Useraccounts with React, flow router addon (With a modified versión with fully functional react support) and i customize almost all templates with meteor-useraccounts/unstyled.

But i have two problems.

  1. With the /verify-email route. If i don’t send the token the system shows me the page with an error but i want to customize it. I don’t find the template in “Unstyled” package. How i can style the template for “verify-email”

  2. If the email is verified. The index is loaded in /verify-email and i lost all the images. How i can redirect after the email is verified to the index? (something like: Flowrouter.go(’/’); )

Thanks

Hi there,

Follow guides from here (https://github.com/meteor-useraccounts/core/blob/master/Guide.md) that every form having its state(https://github.com/meteor-useraccounts/core/blob/master/Guide.md#internal-states)

We can create our customize template by clarifying the state is verifyEmail

File: myCustomVerifyEmailForm.html

<template name="verifyEmailForm">
    <div class="main container">
             {{> atForm state='verifyEmail'}}
        </div>
    </div>
</template>

As I know that with this state, the atForm only shows the atResult (https://github.com/meteor-useraccounts/unstyled/tree/master/lib) which we can customize and do whatever we want.

File: over-atResult.html

<template name="ovr-atResult">
    <div class="at-result">
        I do what I want here. 
        {{result}}
    </div>
</template>

Next, we can also change the verifyEmail message by change text’s info configuration

AccountsTemplates.configure({
    texts: {
        info: {
            emailVerified: "Congratulation!!! Your email is verified successfully. We are redirecting...",
        }
    }
});

Finally we can specify the template for verifyEmail route by:

AccountsTemplates.configureRoute('verifyEmail', {
	name: 'verifyEmail',
	template: 'myCustomVerifyEmailForm'
});

P/s: Hope can help you to solve your problem. I’m using blade and iron-route but I think you can apply same to your situation. Cheers.

Hi @gaupoit,

I have the same issue and I config my AccountTemplates like in your post with:

AccountsTemplates.configureRoute('verifyEmail', {
	name: 'verifyEmail',
	template: 'myCustomVerifyEmailForm'
});

with the two templates without success. The custom templates will not be loaded. When I click on the “Verfiy-Link” I get an emtpy page and after a few seconds I will be redirected to my “HomeTemplate”.

The only code which is working is: (Stackoverflow)

AccountsTemplates.configureRoute('verifyEmail', {
  redirect: function(){
       /* DO SOME STUFF HERE */
  }
});

Can you help why the custom template is not working?


Meteor 1.4.
accounts-base@1.2.14
accounts-password@1.3.3
useraccounts:core@1.14.2
useraccounts:flow-routing@1.14.2
useraccounts:unstyled@1.14.2