I created a custom login page and used Meteor.loginWithPassword (user, password, [callback]) function to login in the app. The login template is the following:
& lt; Template name = "Login" & gt; & Lt; Form class = "login-form form-horizontal" & gt; & Lt; Div class = "control-group" & gt; & Lt; Input class = "email" type = "text" placeholder = "email" & gt; & Lt; / Div & gt; & Lt; Div class = "control-group m-inputwrapper" & gt; & Lt; Input class = "password" type = "password" placeholder = "password" & gt; & Lt; / Div & gt; & Lt; Div class = "control-group" & gt; & Lt; Button type = "submit" class = "submit t-btn-login" & gt; Login & lt; / Button & gt; & Lt; / Div & gt; & Lt; / Form & gt; & Lt; Div class = "alert-container" & gt; & Lt; Div class = "alert-placeholder" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Template & gt; Template.Login.events ({'Submit .login-form': function (e, t) {e.preventDefault (); // input field values var email = t.find ('. Email') Value, password = t.find ('.password'). Value; Meteor.loginWithPassword (email, password, function (error) {$ (".path-placeholder"). Html ('& lt ; div> "icon-icon"> & gt; '+ err.message +' & lt; / span & gt; & lt; / div & gt;; ')}}}; Details are false;}}); As I debugging, I can see that an error message is displayed and added to the Dome. But it will be refreshing and the message will disappear.
Meteor.loginWithPassword () is the meteor after the page mentioned again? When using meteor, if you find yourself injecting HTML elements with jQuery, how can you remove it?
In your alert container, conditionally an error message:
& lt; Div class = "alert-container" & gt; {{#if error message}} & lt; Div class = "alert" & gt; & Lt; Span & gt; & Lt; I class = "icon-mark" & gt; & Lt; / I & gt; {{Error message}} & lt; / Span & gt; & Lt; / Div & gt; {{/ If}} & lt; / Div & gt; In your login callback, set error message if err exists: Meteor.loginWithPassword (email, password, function (error) {if (err) {session .set ('errorMessage', err.message);}}); Finally, add a template assistant to use the error message session variable: Template.Login.helpers ({errorMessage: function () {return Session.get ('errorMessage');}});
Popular posts from this blog
I'm in the middle of homework work and I'm stuck. At this point in my code, I think that I should have a GUI window that opens and allows me to type "inserted text number". Notice is not going anywhere but at this point, If I pass through the problem then it will be in a linked list. I am getting two of the same error for the lines. Add (index, element); And I can not seem to get past it, there is no suitable method for the error "add (int, java. string string)". Code is below, please advise. To clarify - this will not be a method error because it is a linked list. There should not be any way involved. import java.awt. *; Import java.awt.event. *; Import javax.swing. *; Import java.util. *; Import java.util.Scanner; Import java.util.LinkedList; Public class TopTenList JFrame {Private TopTenList tt; See the Private JTextArea list; Private JTextField cmdTextField; Private JTextField resultsTestfield; // This GUI window is the code for the public toptist...
I am using JPA 2.0 and getting the following code in the DAO layer: Public Zero Test () {string key = "status"; String [] Conditions = {"A", "B"}; & Lt; TestTable & gt; Results = Search (Keys, Conditions); } Public listing & lt; TestTable & gt; Search (string key, object value error) {string sql = "test ndf to testlet and jade nand." + Key + "in:" + key; TypedQuery & LT; TestTable & gt; Query = entityManager.createQuery (SQL, TestTable.class); Query.setParameter (key, Arrays.asList (valueArr)) / *** Error Line *** Return query.getResultList (); } In the above error line, it throws the following exception: java.lang.IllegalArgumentException: parameter value element [[Ljava.lang.String; @ cbe5bc] did not match the expected type [java.lang.String] Why is this expected type string while actually this string []? Please help! Note: This is derived from the normal routine and is a simplified code. I can no...
Yes, I know, there is a question with almost the same title, but it refers to a different situation. Error message) In my case, I have a .cpp file with a big named designation name (implementation details). There is a property class template with a static data member in that name space, which I need to access from outside the unknown namespace. I give it a little bit of meat: file.hpp namespace Bar {template & lt; Typename A & gt; Struct foo {static_assert (is_same & lt; a, float & gt; :: value} is_same & lt; a, double>: value, ""); Fixed zero set_static_var (a const & x); // ...}; } and file.cpp namespace {template & lt; Typename A & gt; Struct foo_traits {// supports the implementation of several static code bars: foo & lt; & Gt; Fixed A data; }; The template's & lt; & Gt; Float foo_traits & lt; Float & gt; :: datum; // No change if this is in the global namespace template & lt; & Gt; Doub...
Comments
Post a Comment