Code Monkey home page Code Monkey logo

Comments (5)

zollodavide avatar zollodavide commented on June 1, 2024

I have NuGet v3.0.5

from firebase-authentication-dotnet.

luccasclezar avatar luccasclezar commented on June 1, 2024

Yeah, my PR was merged on June, but I can't see the method in the library.

While this issue is happening you can use this code to delete users:

/// <summary>
/// Deletes the user with a recent Firebase Token.
/// </summary>
/// <param name="token"> Recent Firebase Token. </param>
public static async Task DeleteUser(string firebaseToken)
{
    var googleDeleteUserUrl = "https://www.googleapis.com/identitytoolkit/v3/relyingparty/deleteAccount?key={0}";
    var content = $"{{ \"idToken\": \"{firebaseToken}\" }}";
    var responseData = "N/A";

    try
    {
        var response = await new HttpClient().PostAsync(new Uri(string.Format(googleDeleteUserUrl, [YOUR_FIREBASE_KEY])), new StringContent(content, Encoding.UTF8, "application/json"));
        responseData = await response.Content.ReadAsStringAsync();

        response.EnsureSuccessStatusCode();
    }
    catch (Exception ex)
    {
        throw new FirebaseAuthException(googleDeleteUserUrl, content, responseData, ex, GetFailureReason(responseData));
    }
}

And copy this method to your code too:

private static AuthErrorReason GetFailureReason(string responseData)

This is exactly the same method of the library and you use it the same way, just remember to replace [YOUR_FIREBASE_KEY] with your firebase key.

from firebase-authentication-dotnet.

zollodavide avatar zollodavide commented on June 1, 2024

Thank you, I'll use the code in the meantime, and I'll be waiting for the update!

from firebase-authentication-dotnet.

zollodavide avatar zollodavide commented on June 1, 2024

@luccasclezar for your information, AuthErrorReason.UserNotFound inside the method GetFailureReason seems not to be found either

from firebase-authentication-dotnet.

bezysoftware avatar bezysoftware commented on June 1, 2024

I just deployed the latest code to nugget, it will be available in a bit after it gets indexed

from firebase-authentication-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.