dazzle
dazzle

Reputation: 1346

authenticate user on offline mode

We have a app which works offline as the data is stored locally using local storage and HTML5 offline capabilities.

We want a way to authenticate the user when the user tries to launch the app offline (from a security purpose if ipad gets stolen).

We already have the authentication mechanism when the user tries to access the app while online

Upvotes: 0

Views: 919

Answers (2)

Jayprakash Dubey
Jayprakash Dubey

Reputation: 36447

One solution is to save the last successful online login into some local storage. Now when user is in offline-mode then compare with the value stored in Local Storage.

Following is the sample snippet for Local Storage in HTML 5 :

if (window.localStorage.getItem('value')) {
    dummy =  window.localStorage.getItem('value');
} 

Hope this might solve the problem.

Upvotes: 0

Kernel James
Kernel James

Reputation: 4074

Crudely, you can use the person's password as the local storage database name. No password, no database access.

Upvotes: 3

Related Questions