Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7783229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:46:31+00:00 2026-06-01T19:46:31+00:00

I started this example project to learn meteor: https://github.com/andrewarrow/question-raven/ I’m trying to duplicated a

  • 0

I started this example project to learn meteor:

https://github.com/andrewarrow/question-raven/

I’m trying to duplicated a popular question/answer site functionality just to learn meteor.

Above my login form I have this in the template:

 {{#if invalid }}
<div style="background-color: yellow; padding: 3px 3px 3px 3px;">
login invalid, please try again.
</div>
{{/if}}

and I’m starting the login logic like this:

Template.hello.events = {
  'click #login' : function () {
    var email = $('#email').val();
    var password = $('#password').val();
    if (false) {
      Session.set('user_id', 1);
    } else {
      Session.set('invalid', 1);
    }
  }
};

Then in order for the invalid variable to work in the template I have this function:

Template.hello.invalid = function () {
  return Session.get('invalid') != null;
};

Is this the right way to do this? Does every variable the template references have to be a function? Should I use the Session store to record a login was invalid so a function can return true/false?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:46:33+00:00Added an answer on June 1, 2026 at 7:46 pm

    Short answer – you can’t do it (yet). But I’m sure the meteor team is working hard on it, since it’s a big hole in the framework at the moment.

    The way you’re doing it in this example would be insecure in any client-side framework since you’re setting the value of a javascript variable to enforce authentication. I can run Session.set('invalid', null); in the chrome console and log myself in.

    The canonical way of logging in is to have the server hash the password and compare it to the username/password table in the database, if it’s valid create a session token in another database table with an expires datetime, then give the session token to the browser to send you with future requests (usually stored in a cookie). This doesn’t work in Meteor because the client has full read/write access to any collection in the database.

    You could, potentially, have a completely separate database running that Meteor doesn’t know about, and set up meteor functions on the server that access it with node.js code (pybassing meteor Collections altogether). You could pub/sub only the public data from that database to see the data auto-update in your client. It would be really messy, and I’m not even positive it would work – you’re much better off not using meteor if you need authentication right now.

    A partial solution (and very easy to implement) is to use HTTP authentication. It doesn’t work for a user system since nobody can sign up, but it would keep strangers from seeing your code/ accessing your database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm following this example: http://www.codinghorror.com/blog/2005/12/getting-started-with-indexing-service.html However, the conversion to dataset shows empty columns for
I started to learn Java, JSF2 and JPA2 and used Pet Catalog example project
From this example http://www.smartclient.com/smartgwt/showcase/#tree_databinding_local , I started to implement my own tree structure dynamically
I have started learning HTTPUNIT and found one basic example. In this example it
I originally started this question in another thread, but that thread was sorta, kinda
I've started this question Named route with nested resources , and it lead me
Started with this question: OpenID. How do you logout OK. So OpenID does not
This started as a question, but turned into a solution as I did some
Many data analysts that I respect use version control. For example: http://github.com/hadley/ See comments
I recently started a project, using Apple's Utility Application example project. In the example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.