con un clic
revyl-cli-auth-bypass-flutter
// Flutter leaf recipe for test-only auth bypass deep links using Revyl launch variables.
// Flutter leaf recipe for test-only auth bypass deep links using Revyl launch variables.
Create robust Revyl E2E tests using CLI commands from app source analysis or exploratory sessions.
Create and maintain Revyl tests through MCP tools using create/update operations and execution feedback loops.
MCP dev-first mobile loop for reliable screenshot-observe-action execution, grounded interactions, and conversion of successful exploratory paths into tests.
Analyze failed Revyl test, workflow, and device-session reports via CLI to classify real bugs, flaky tests, infra issues, setup failures, or test-design improvements.
Native Android leaf recipe for test-only auth bypass deep links using Revyl launch intent extras.
Expo and Expo Router leaf recipe for test-only auth bypass deep links using Revyl launch variables.
| name | revyl-cli-auth-bypass-flutter |
| description | Flutter leaf recipe for test-only auth bypass deep links using Revyl launch variables. |
Use this leaf skill when revyl-cli-auth-bypass has selected a Flutter app. This is app code guidance, not a Revyl authentication shortcut.
For the first-pass setup, start from revyl-cli-auth-bypass; it detects the stack, applies the shared safety contract, and delegates here for Flutter implementation details.
revyl dev list, screenshots, or reports can answer the question..claude/skills slash-command discovery plus WebFetch/WebSearch or configured MCP/browser tools; Cursor .cursor/skills plus .cursor/rules/revyl-skills.mdc and available MCP/browser tools.revyl device screenshot or revyl device report instead of claiming browser access.Use one app-specific deep link shape:
myapp://revyl-auth?token=<token>&role=<role>&redirect=<allowlisted-route>
Gate the handler with Revyl launch variables:
revyl global launch-var create REVYL_AUTH_BYPASS_ENABLED=true
revyl global launch-var create REVYL_AUTH_BYPASS_TOKEN=<test-only-token>
REVYL_AUTH_BYPASS_* to Dart.Use the app's existing deep-link package if it already has one. This example uses app_links:
import 'package:app_links/app_links.dart';
import 'package:flutter/services.dart';
const launchConfig = MethodChannel('app.launchConfig');
final allowedRedirects = {
'/account': AppRoute.account,
'/checkout': AppRoute.checkout,
'/cart': AppRoute.cart,
};
final allowedRoles = {'buyer', 'support'};
Future<void> handleRevylAuthBypass(Uri uri) async {
if (uri.scheme != 'myapp' || uri.host != 'revyl-auth') return;
final config = await launchConfig.invokeMapMethod<String, String>('revylAuthBypass');
final enabled = config?['REVYL_AUTH_BYPASS_ENABLED'] == 'true';
final expectedToken = config?['REVYL_AUTH_BYPASS_TOKEN'];
final role = uri.queryParameters['role'] ?? 'buyer';
final redirect = uri.queryParameters['redirect'] ?? '/account';
if (!enabled) throw StateError('Revyl auth bypass is disabled');
if (uri.queryParameters['token'] != expectedToken) throw StateError('Bad Revyl auth bypass token');
if (!allowedRoles.contains(role)) throw StateError('Role is not allowlisted');
final route = allowedRedirects[redirect];
if (route == null) throw StateError('Redirect is not allowlisted');
await TestSession.signIn(role: role);
appRouter.go(route);
}
Future<void> installRevylAuthBypass() async {
final links = AppLinks();
final initial = await links.getInitialLink();
if (initial != null) await handleRevylAuthBypass(initial);
links.uriLinkStream.listen((uri) async {
try {
await handleRevylAuthBypass(uri);
AuthBypassStatus.accepted();
} catch (error) {
AuthBypassStatus.rejected(error.toString());
}
});
}
Replace TestSession, appRouter, AppRoute, and AuthBypassStatus with the app's real session, router, and debug UI.
Expose launch config through a platform channel, or verify the token against a staging backend from Dart. The platform channel should return only:
{
"REVYL_AUTH_BYPASS_ENABLED": "true",
"REVYL_AUTH_BYPASS_TOKEN": "<test-only-token>"
}
Use the same native sources as the dedicated leaves:
ProcessInfo.processInfo.arguments.Intent string extras.myapp to CFBundleURLTypes in ios/Runner/Info.plist.android:scheme="myapp" and android:host="revyl-auth" in android/app/src/main/AndroidManifest.xml.Start a fresh Revyl session with launch vars attached:
export REVYL_AUTH_BYPASS_TOKEN="<test-only-token>"
revyl global launch-var update REVYL_AUTH_BYPASS_TOKEN --value "$REVYL_AUTH_BYPASS_TOKEN"
revyl dev --no-build \
--launch-var REVYL_AUTH_BYPASS_ENABLED \
--launch-var REVYL_AUTH_BYPASS_TOKEN
Then verify valid and rejected links:
revyl device navigate --url "myapp://revyl-auth?token=$REVYL_AUTH_BYPASS_TOKEN&role=buyer&redirect=%2Fcheckout"
revyl device screenshot --out /tmp/revyl-auth-bypass-flutter-valid.png
revyl device navigate --url "myapp://revyl-auth?token=wrong-token&role=buyer&redirect=%2Fcheckout"
revyl device navigate --url "myapp://revyl-auth?token=$REVYL_AUTH_BYPASS_TOKEN&role=admin&redirect=%2Fcheckout"
revyl device navigate --url "myapp://revyl-auth?token=$REVYL_AUTH_BYPASS_TOKEN&role=buyer&redirect=%2Fadmin"
revyl device screenshot --out /tmp/revyl-auth-bypass-flutter-rejected.png
REVYL_AUTH_BYPASS_ENABLED=true.