unauthorize static method

Future<void> unauthorize()

Method that revokes the current access, refreshes tokens and deletes them from the SharedPreferences.

Implementation

static Future<void> unauthorize() async {

    // Remove the tokens from shared preferences
    GetIt.instance<SharedPreferences>().remove('dexcomAccessToken');
    GetIt.instance<SharedPreferences>().remove('dexcomRefreshToken');
    GetIt.instance<SharedPreferences>().remove('dexcomTokenExpires');
    GetIt.instance<SharedPreferences>().remove('dexcomRedirectUri');

    // Debugging
    final logger = Logger();
    logger.i('Tokens deleted successfully.');

}