Update auth.go

code optimization