Fastlane Screenshots with Authentication
Please check in Fastlane docs Launch Arguments under Advanced Snapshot section https://docs.fastlane.tools/getting-started/ios/screenshots/ I think it can help


  Launch Arguments
  
  You can provide additional arguments to your app on launch. These
  strings will be available in your app (eg. not in the testing target)
  through NSProcessInfo.processInfo().arguments. Alternatively, use
  user-default syntax (-key value) and they will be available as
  key-value pairs in NSUserDefaults.standardUserDefaults().

launch_arguments([
  "-firstName Felix -lastName Krause"
])

name.text = NSUserDefaults.standardUserDefaults().stringForKey("firstName")
// name.text = "Felix"

  
  snapshot includes -FASTLANE_SNAPSHOT YES, which will set a temporary user default for the key FASTLANE_SNAPSHOT, you may use
  this to detect when the app is run by snapshot.

if NSUserDefaults.standardUserDefaults().boolForKey("FASTLANE_SNAPSHOT")

  
  {
          // runtime check that we are in snapshot mode
      }
  
  Specify multiple argument strings and snapshot will generate
  screenshots for each combination of arguments, devices, and languages.
  This is useful for comparing the same screenshots with different
  feature flags, dynamic text sizes, and different data sets.

# Snapfile for A/B Test Comparison
launch_arguments([
  "-secretFeatureEnabled YES",
  "-secretFeatureEnabled NO"
])