Login credential validation extension

// @module JJ.LoginCredentialValidation.LoginCredentialValidation
define('JJ.LoginCredentialValidation.LoginCredentialValidation.View'
,	[
	'jj_logincredentialvalidation_logincredentialvalidation.tpl'	
	,	'Backbone','GlobalViews.Message.View'
    ]
, function (
	jj_logincredentialvalidation_logincredentialvalidation_tpl	
	,	Backbone,GlobalViewsMessageView
)
{
    'use strict';

	// @class JJ.LoginCredentialValidation.LoginCredentialValidation.View @extends Backbone.View
	return Backbone.View.extend({

		template: jj_logincredentialvalidation_logincredentialvalidation_tpl

	,	initialize: function (options) {

			/*  Uncomment to test backend communication with an example service
				(you'll need to deploy and activate the extension first)
			*/

			// this.model = new LoginCredentialValidationModel();
			// var self = this;
         	// this.model.fetch().done(function(result) {
			// 	self.message = result.message;
			// 	self.render();
      		// });
			  _.extend(GlobalViewsMessageView.prototype,{

				getContext: _.wrap(GlobalViewsMessageView.prototype.getContext, function (fn) {

				var passincorect = fn.apply(this, _.toArray(arguments).slice(1));

				console.log("password incorect mesg",passincorect);
				//console.log("modelsqu value",productlineSku.sku);
				//if to check for login page only
				var url = window.location.href;
				if (url.indexOf("login") > -1) {
				console.log('abbb')

				passincorect.message="Incorrect email or password. Please correct your email and password."
				}
				//var badge = this.model.attributes.item.attributes.custitem28
				//originalRet.badge = badge;
				return passincorect;
				})

			})
		}

	,	events: {
		}

	,	bindings: {
		}

	, 	childViews: {

		}

		//@method getContext @return JJ.LoginCredentialValidation.LoginCredentialValidation.View.Context
	
	});
});

Leave a comment

Your email address will not be published. Required fields are marked *