Implemented authenticate function over login model