Meteorのアカウントパスワードパッケージを使用して、React/Meteorで動作するように電子メール認証を取得しようとしています。私はリアクタを使っています。私はどこにこれを呼び出す方法/入れするかわからない:MeteorのAccounts.onEmailVerificationLinkとReactとReact Router
Accounts.onEmailVerificationLink(function(token, done) {
Accounts.verifyEmail(token);
});
私がサインアップコンポーネントとコンテナを持っている、と私は/サインインコンポーネントにリンクする確認メールを取得しようとしていますコンテナを確認してください。 。私は流星で、次のやった(isServer)Meteor.startupブロック:
Accounts.urls.verifyEmail = function(){
return Meteor.absoluteUrl("restaurantsignin");
};
私は、ルータのファイルを反応させるには、次のようになります。
Meteor.startup(() => {
render(
<Router history={browserHistory}>
<Route path="/" component={App}>
<IndexRoute component={Home} />
<Route path="/about" component={About} />
<Route path="/restaurantsignin" component={RestaurantSignInContainer} />
<Route path="/restaurantsignup" component={RestaurantSignUpContainer} />
<Route path="/customersignup" component={CustomerSignUpContainer} />
<Route path="/restaurantresetemail" component={RestaurantResetEmailContainer} />
<Route path="/restaurantresetpassword" component={RestaurantResetPasswordContainer} />
<Route path="/restaurant/:restaurantName" component={MenuPage} />
</Route>
</Router>, document.getElementById('app')
);
});
私は、コンポーネントファイルは次のようになり反応:
import React from 'react';
import Radium from 'radium';
import ReactDOM from 'react-dom';
import { Alert, Button } from 'react-bootstrap';
export default class RestaurantSignIn extends React.Component {
handleAlertVerifiedDismiss() {
document.getElementById('alert_verified_box').style.display = 'none';
}
render() {
var styles = {
.
.
.
return (
<div style={styles.signInContainer}>
.
.
.
and so on
電子メールの確認リンクが正常に送信されており、/ barsigninリンクに正しくリダイレクトされています。私はユーザーがログインページに達するとユーザーを正しく検証する方法がわかりません - ログインする前に(リンクをクリックするとすぐに)確認しておきたい - 流星のドキュメントが使用すると言っています上記のアカウントコードスニペットを超えていますが、私はオンラインで何かを発見していません。助けてくれてありがとう!あなたは次の操作を行うことができますので
感謝を!それは動作します。私は 'this.props.history.replace'の代わりに' browserHistory.push'を使用します。 – novasaint