-
-
Save Vanethos/a8e756b88262caef440135368b2540ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dynamic responseInterceptor(Response options) async { | |
if (options.headers.value("verifyToken") != null) { | |
//if the header is present, then compare it with the Shared Prefs key | |
SharedPreferences prefs = await SharedPreferences.getInstance(); | |
var verifyToken = prefs.get("VerifyToken"); | |
// if the value is the same as the header, continue with the request | |
if (options.headers.value("verifyToken") == verifyToken) { | |
return options; | |
} | |
} | |
return DioError(request: options.request, message: "User is no longer active"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment