Extract auth to before in application