Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'processRequest':function(request) {
if(request.add_user === undefined) {
request.add_user = request_add_user;
request.get_user = request_get_user;
request._users = {};
}
var user_id = request.session.get(utils.get_session_key(this)),
backend_name = request.session.get(utils.get_session_backend(this)),
self = this;
if(user_id !== undefined && backend_name !== undefined) {
utils.get_user(self, backend_name, user_id, function(user) {
request.add_user(self, user);
request.attemptContinue();
});
} else {
request.attemptContinue();
}
}
};
utils.authenticate(this, credentials, function(backend, user) {
if(user === undefined || user instanceof utils.AnonymousUser) {
renderToResponse(request)(kwargs.auth_form, {
'errors':'Could not log you in',
});
} else {
var redirect_to = request.GET[kwargs.redirect_key] || '/';
request.session.set(utils.get_session_backend(self), backend.name);
request.session.set(utils.get_session_key(self), user.id);
request.respond(new http.HttpResponseRedirect(redirect_to));
}
});
} else {