Changed order of action, added password encoding
password encoding added
Changed order of login processing
Changed login If check