[642] Moves auth checks to functions using IAuthFunctions instead of inline checks