Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

DataDeletionMigration.cs

using FluentMigrator;
using Nop.Data;
using Nop.Data.Migrations;
using Nop.Services.Localization;
using Nop.Web.Framework.Extensions;

namespace Nop.Plugin.ExternalAuth.Facebook.Migrations;

[NopMigration("2022-06-23 00:00:00", "ExternalAuth.Facebook 1.77. Data deletion feature", MigrationProcessType.Update)]
public class DataDeletionMigration : MigrationBase
{
    #region Fields

    protected readonly ILanguageService _languageService;
    protected readonly ILocalizationService _localizationService;

    #endregion

    #region Ctor

    public DataDeletionMigration(ILanguageService languageService,
        ILocalizationService localizationService)
    {
        _languageService = languageService;
        _localizationService = localizationService;
    }

    #endregion

    #region Methods

    /// 
    /// Collect the UP migration expressions
    /// 
    public override void Up()
    {
        if (!DataSettingsManager.IsDatabaseInstalled())
            return;

        var (languageId, _) = this.GetLanguageData(_languageService);

        _localizationService.AddOrUpdateLocaleResource(new Dictionary
        {
            ["Plugins.ExternalAuth.Facebook.AuthenticationDataDeletedSuccessfully"] = "Data deletion request completed",
            ["Plugins.ExternalAuth.Facebook.AuthenticationDataExist"] = "Data deletion request is pending, please contact the admin",
            ["Plugins.ExternalAuth.Facebook.Instructions"] = "

To configure authentication with Facebook, please follow these steps:

  1. Navigate to the Facebook for Developers page and sign in. If you don't already have a Facebook account, use the Sign up for Facebook link on the login page to create one.
  2. Tap the + Add a New App button in the upper right corner to create a new App ID. (If this is your first app with Facebook, the text of the button will be Create a New App.)
  3. Fill out the form and tap the Create App ID button.
  4. The Product Setup page is displayed, letting you select the features for your new app. Click Get Started on Facebook Login.
  5. Click the Settings link in the menu at the left, you are presented with the Client OAuth Settings page with some defaults already set.
  6. Enter \"{0:s}signin-facebook\" into the Valid OAuth Redirect URIs field.
  7. From User data deletion dropdown menu select \"Data deletion instructions URL\"
  8. Enter \"{0:s}facebook/data-deletion-callback/\" into the User data deletion input field.
  9. Click Save Changes.
  10. Click the Dashboard link in the left navigation.
  11. Copy your App ID and App secret below.


" }, languageId); } /// /// Collects the DOWN migration expressions /// public override void Down() { //nothing } #endregion }