Change request.user = user to auth.login()

I changed the middleware because user assign to request.user not really signin and the authentication was doing all time. 

Sorry my bad english, I am learning... :)