Skip to content

Commit a11e9b1

Browse files
authored
Merge pull request #130 from NewDEV-github/developer
Upgrade authentication error code list and their display
2 parents 5156ace + 86b2e1a commit a11e9b1

9 files changed

Lines changed: 29 additions & 11 deletions

Scenes/Menu.tscn

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ anchor_bottom = 1.0
2424
mouse_filter = 1
2525
theme = ExtResource( 2 )
2626
script = ExtResource( 1 )
27-
__meta__ = {
28-
"_edit_use_anchors_": false
29-
}
3027

3128
[node name="bg" type="TextureRect" parent="."]
3229
anchor_right = 1.0
@@ -354,6 +351,7 @@ align = 1
354351
valign = 1
355352

356353
[node name="LoginPanel" parent="." instance=ExtResource( 8 )]
354+
visible = true
357355
margin_right = 755.0
358356

359357
[node name="Control" parent="." instance=ExtResource( 3 )]
@@ -370,7 +368,6 @@ margin_right = -0.196045
370368
margin_bottom = -0.200012
371369

372370
[node name="DownloadableContent" type="WindowDialog" parent="."]
373-
visible = true
374371
margin_right = 702.0
375372
margin_bottom = 503.0
376373
__meta__ = {

Scripts/LoginPanel.gd

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,28 @@ extends WindowDialog
55
# var a = 2
66
# var b = "text"
77
var errors = {
8-
"INVALID_EMAIL": "Invalid email address",
9-
"EMAIL_NOT_FOUND": "Email address not found",
10-
"INVALID_PASSWORD": "Invalid password",
11-
"USER_DISABLED": "That user is disabled/banned",
12-
"WEAK_PASSWORD": "Weak password. It must be at least 6 characters long"}
8+
"USER_NOT_FOUND": "The user corresponding to the refresh token was not found. It is likely the user was deleted.",
9+
"TOKEN_EXPIRED": "The user's credential is no longer valid. The user must sign in again.",
10+
"INVALID_CUSTOM_TOKEN": "The custom token format is incorrect or the token is invalid for some reason (e.g. expired, invalid signature etc.)",
11+
"CREDENTIAL_MISMATCH": "The custom token corresponds to a different Firebase project.",
12+
"INVALID_REFRESH_TOKEN": "An invalid refresh token is provided.",
13+
"INVALID_GRANT_TYPE": "The grant type specified is invalid.",
14+
"MISSING_REFRESH_TOKEN": "No refresh token provided.",
15+
"EMAIL_EXISTS": "The email address is already in use by another account.",
16+
"OPERATION_NOT_ALLOWED": "This feature is disabled for this project.",
17+
"TOO_MANY_ATTEMPTS_TRY_LATER": "We have blocked all requests from this device due to unusual activity. Try again later.",
18+
"EMAIL_NOT_FOUND": "There is no user record corresponding to this identifier. The user may have been deleted.",
19+
"INVALID_PASSWORD": "The password is invalid or the user does not have a password.",
20+
"USER_DISABLED": "The user account has been disabled by an administrator.",
21+
"INVALID_IDP_RESPONSE": "The supplied auth credential is malformed or has expired.",
22+
"INVALID_EMAIL": "The email address is badly formatted.",
23+
"EXPIRED_OOB_CODE": "The action code has expired.",
24+
"INVALID_OOB_CODE": "The action code is invalid. This can happen if the code is malformed, expired, or has already been used.",
25+
"INVALID_ID_TOKEN": "The user's credential is no longer valid. The user must sign in again.",
26+
"WEAK_PASSWORD": "The password must be 6 characters long or more.",
27+
"CREDENTIAL_TOO_OLD_LOGIN_AGAIN": "The user's credential is no longer valid. The user must sign in again.",
28+
"FEDERATED_USER_ID_ALREADY_LINKED": "This credential is already associated with a different user account.",
29+
}
1330

1431
# Called when the node enters the scene tree for the first time.
1532
func _ready():
@@ -22,7 +39,10 @@ func _ready():
2239
func on_login_failed(error_code, message):
2340
print("error code: " + str(error_code))
2441
print("message: " + str(message))
25-
$Error.dialog_text = "Error: " + errors[message]
42+
if errors.has(message):
43+
$Error.dialog_text = "Error: " + errors[message] + "\n\nError code: " + str(error_code)
44+
else:
45+
$Error.dialog_text = "Oops!\nUnknown error happened!\n\nError code: " + str(error_code)
2646
$Error.popup_centered()
2747

2848
func _on_Login_pressed():

Scripts/Menu.gd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ func _ready() -> void:
3030
$VBoxContainer3/Logout.disabled = true
3131
$VBoxContainer3/Login.disabled = false
3232
Firebase.Auth.connect("login_succeeded", self, "_on_FirebaseAuth_login_succeeded")
33+
Firebase.Auth.connect("login_failed", self, "_on_FirebaseAuth_login_failed")
3334
Firebase.Auth.connect("signup_succeeded", self, "_on_FirebaseAuth_login_succeeded")
3435
if Firebase.Auth.check_auth_file():
3536
Firebase.Auth.load_auth()
1.28 KB
Binary file not shown.
2 KB
Binary file not shown.
-2 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
14.5 KB
Binary file not shown.

version.dat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.2.2
1+
v1.2.3

0 commit comments

Comments
 (0)