fix login issue by passing in model instead of object