move trasaction from controller to user model
change login logic