auth middleware to login, Api interface v1 fix #2