New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

auth-component

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auth-component - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

2

package.json
{
"name": "auth-component",
"version": "0.1.2",
"version": "0.1.3",
"description": "An Authenication Component for DoneJS",

@@ -5,0 +5,0 @@ "main": "src/auth-component.js",

@@ -81,5 +81,9 @@ import $ from 'jquery';

login(username, password){
login(username, password, ev){
var self = this;
if (ev) {
ev.preventDefault();
}
this.attr('loggingIn', true);

@@ -97,2 +101,3 @@ this.attr('loginError', false);

// Couldn't login with username / password.
}, function(error){

@@ -118,5 +123,9 @@ self.attr('loggingIn', false);

this.sendLogin(params).then(function(response){
// Check for responseTokenPath and responseDataPath.
// console.log('tokenLogin response: ', response);
// TODO: Check for responseTokenPath and responseDataPath.
self.attr('auth', response);
// Couldn't login with broken or expired token. Discard the token.
}, function(){
self.attr('loading', false);
self.removeStoredToken(self.attr('rememberMe'), self.attr('keyLocation'));
});

@@ -149,2 +158,16 @@ },

/**
* Removes the auth token from either sessionStorage or localStorage.
* @param {Bookean} rememberMe If true, the token is in localStorage,
* otherwise, it's in sessionStorage
* @param {String} location The key name of the location in storage.
*/
removeStoredToken(rememberMe, location){
if (rememberMe) {
window.localStorage.removeItem(location);
} else if(window.sessionStorage) {
window.sessionStorage.removeItem(location);
}
},
/**
* Toggles a loading indicator until it's decided if the login form should show or not.

@@ -151,0 +174,0 @@ * @type {Boolean}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc