selaias / meteor-accounts-entry-flowrouter Goto Github PK
View Code? Open in Web Editor NEWMake signin and signout their own pages with routes (with flowrouter)
License: MIT License
Make signin and signout their own pages with routes (with flowrouter)
License: MIT License
Just checking. As you know not all repos accept PRs...
We have noticed that in the verification email, the URL is:
http://[domain]/#/verify-email/[token]
However, for the reset password email, the URL is:
http://[domain]/reset-password/[token]
Which is missing the #
after the domain name. As a result, it does not trigger the provided templates on click in the email and just redirects to a blank page. If the URL is copy and pasted into the browser with a #
added, then the templates with this module work as intended.
Something strange happening here.
When I go directly to the URL "/accounts/sign-in" in my browser (http://localhost:3000/accounts/sign-in), I get an error: BlazeLayout warning: unknown template ""
However, if I add my own routes "/sign-up" and "/sign-in" to my app, I can go directly to those pages in the browser and the sign-in/sign-up forms render correctly. But if I click the "sign-in" link when viewing the "sign-up" page, it takes me to "accounts/sign-in" but nothing is rendered. No errors display in the console either.
<template name="mainLayout">
{{> Template.dynamic template=content}}
</template>
<template name="home">
<div class="container">
<h1>Welcome!</h1>
<p>
<a href="/sign-up">Sign-up</a>
</p>
<p>
<a href="/sign-in">Sign-in</a>
</p>
</div>
</template>
<template name="signup">
{{> entrySignUp}}
</template>
<template name="signin">
{{> entrySignIn}}
</template>
With the following router.js setup:
FlowRouter.route('/', {
action: function() {
BlazeLayout.render('mainLayout', {
content: 'home'
});
}
});
FlowRouter.route('/sign-up', {
action: function() {
BlazeLayout.render('mainLayout', {
content: 'signup'
});
}
});
FlowRouter.route('/sign-in', {
action: function() {
BlazeLayout.render('mainLayout', {
content: 'signin'
});
}
});
and accountsEntryConfig.js:
// accountsEntryConfig.js
Meteor.startup(function() {
AccountsEntry.config({
layoutName: "mainLayout",
privacyUrl: '/privacy-policy',
termsUrl: '/terms-of-use',
homeRoute: '/',
dashboardRoute: '/dashboard',
profileRoute: 'profile',
passwordSignupFields: 'EMAIL_ONLY',
showSignupCode: false,
showOtherLoginServices: true,
fluidLayout: false,
useContainer: true,
waitEmailVerification: true,
emailVerificationPendingRoute: '/verification-pending',
showSpinner: true,
spinnerOptions: {
color: "#000",
top: "80%"
}
});
});
Any ideas how to get the pre-defined routes (/accounts/...) to properly load when hitting the URL directly?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.