GodotNuts / GodotFirebase

Implementations of Firebase for Godot using GDScript
MIT License
554 stars 79 forks source link

Signal added, error handle changed, enum added #229

Closed BearDooks closed 3 years ago

BearDooks commented 3 years ago

This PR changes the error handling of the auth files.

All login and signup functions have a new line to delcare the 'auth_request_type'. This is then used in the error to send the correct type of signal to the user.

    if requesting == Requests.EXCHANGE_TOKEN:
        emit_signal("token_exchanged", false)
        emit_signal("login_failed", res.error, res.error_description)
        emit_signal("auth_request", res.error, res.error_description)
    else:
        var sig = "signup_failed" if auth_request_type == Auth_Type.SIGNUP_EP else "login_failed"
        emit_signal(sig, res.error.code, res.error.message)
        emit_signal("auth_request", res.error.code, res.error.message)
requesting = Requests.NONE
auth_request_type = Auth_Type.NONE

This will close #219