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 7092631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:20:17+00:00 2026-05-28T08:20:17+00:00

I need to check that a user have logged in and been authenticated before

  • 0

I need to check that a user have logged in and been authenticated before letting my him or her use my backbone.js-based application.

The user authentication is stored in a native backbone model as a property, which I check before starting my main router by invoking Backbone.history.start. This way – an unauthenticated user is sent to the login page directly.

Is this sufficient?

if (!myApp.state.loggedIn) {
    window.location.hash = "login"; // Set url to #login
}

Backbone.history.start();  // Start history as usual
  • 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-05-28T08:20:18+00:00Added an answer on May 28, 2026 at 8:20 am

    if access to your backend REST API is protected server side and it wouldn’t allow to access any user data when i’d for example stop the execution of code from developer tools and edit model’s data (like set the state.loggedIn to true and set some user’s i’d like to steal data from ID as my own). You should probably have also cookie session stored and maybe CSRF protection in to prevent cross site request forgery.

    But basically backend should redirect user to login page whenever user isn’t really logged in or his session expired.

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

Sidebar

Related Questions

I need to display an alert to a user, if they have been on
I have a situation where I need to check the roles for a user
I have a check_user_access_control before_filter in my ApplicationController that checks the logged user's roles
I need to check in my portlet wich language does an user have selected
I need to check that a string takes on the format 05:31:2008:06:27:2010 I do
I need an simple way to check whether a string that is sent to
I need to create a javascript function that checks if it has been a
I have some pages that have content that is relevant to both logged in
I have this code that loads on document.ready and it checks if the user
The set-up: I have an android application that so far can register a user

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.