Reset password
This commit is contained in:
@@ -11,6 +11,8 @@ EMAIL,Adresse mail,Correo electrónico,Endereço eletrônico
|
||||
PASSWORD,Mot de passe,Contraseña,Senha
|
||||
LOG_IN,Se connecter,Ingresar,Conexão
|
||||
INVALID_EMAIL_OR_PASSWORD,Adresse mail ou mot de passe invalide,Correo electrónico o contraseña inválida,Endereço de e-mail ou senha inválidos
|
||||
RESET_PASSWORD,Réinitialiser le mot de passe,Restablecer la contraseña,Redefinir senha
|
||||
CHECK_YOUR_EMAIL,Veuillez vérifier votre boîte mail,"Por favor, revise su correo electrónico","Por favor, verifique seu e-mail"
|
||||
DEVICE_NUMBER,Appareil {number},Dispositivo {number},Dispositivo {number}
|
||||
SETTINGS,Paramètres,Configuración,Parâmetros
|
||||
ADULT_CHECK_PROMPT,"Veuillez confirmer que vous êtes un adulte !
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,7 +1,10 @@
|
||||
[gd_resource type="LabelSettings" format=3 uid="uid://ohvlqccl2oog"]
|
||||
[gd_resource type="LabelSettings" load_steps=2 format=3 uid="uid://ohvlqccl2oog"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://dnulwsojj835p" path="res://assets/fonts/kalulu_mulish_black.otf" id="1_pq2gh"]
|
||||
|
||||
[resource]
|
||||
font_size = 32
|
||||
font = ExtResource("1_pq2gh")
|
||||
font_size = 42
|
||||
font_color = Color(1, 0.317647, 0.298039, 1)
|
||||
outline_size = 1
|
||||
outline_color = Color(0, 0, 0, 1)
|
||||
|
||||
@@ -8,6 +8,7 @@ signal logged_in()
|
||||
@onready var login_message: Label = %LoginError
|
||||
@onready var device_id_container: VBoxContainer = %DeviceIDContainer
|
||||
@onready var device_id_field: SpinBox = %DeviceIDField
|
||||
@onready var reset_password_button: Button = %ResetPasswordButton
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
@@ -19,6 +20,7 @@ func _ready() -> void:
|
||||
func _hide_login_error(_value: Variant) -> void:
|
||||
if login_message.is_visible():
|
||||
login_message.hide()
|
||||
reset_password_button.hide()
|
||||
|
||||
|
||||
func _on_login_form_validator_control_validated(control: Control, passed: Variant, messages: PackedStringArray) -> void:
|
||||
@@ -50,6 +52,16 @@ func _on_validate_button_pressed() -> void:
|
||||
else:
|
||||
Log.info("Login: UserDataManager rejected server response during login")
|
||||
login_message.show()
|
||||
reset_password_button.show()
|
||||
else:
|
||||
Log.info("Login: Server responded with code %d for login attempt with email %s" % [res.code, email_field.text])
|
||||
login_message.show()
|
||||
reset_password_button.show()
|
||||
|
||||
|
||||
func _on_reset_password_button_pressed() -> void:
|
||||
var res: Dictionary = await ServerManager.reset_password(email_field.text)
|
||||
if res.code == 200:
|
||||
Log.debug(str(res))
|
||||
else:
|
||||
login_message.text = "CHECK_YOUR_EMAIL"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=36 format=3 uid="uid://6v3nachs7j71"]
|
||||
[gd_scene load_steps=37 format=3 uid="uid://6v3nachs7j71"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bs6h4bd7ml6au" path="res://sources/menus/main/main_menu.gd" id="1_0r1ij"]
|
||||
[ext_resource type="PackedScene" uid="uid://wdjp1sv55q4f" path="res://sources/menus/components/night_sky/night_sky.tscn" id="1_afd4d"]
|
||||
@@ -25,6 +25,7 @@
|
||||
[ext_resource type="Script" uid="uid://dvpln5snrt4mq" path="res://addons/godot-form-validator/rules/email_rule.gd" id="20_jk8lq"]
|
||||
[ext_resource type="Texture2D" uid="uid://bbip3wpyidt1q" path="res://assets/menus/main/play_button_mask.png" id="20_oqrk5"]
|
||||
[ext_resource type="Script" uid="uid://c1cqwb15yoqb3" path="res://addons/godot-form-validator/validators/line_edit_validator.gd" id="21_1bl4i"]
|
||||
[ext_resource type="LabelSettings" uid="uid://ohvlqccl2oog" path="res://resources/themes/error_label_settings.tres" id="24_y5bcl"]
|
||||
[ext_resource type="Script" uid="uid://58twmknv6bl5" path="res://sources/ui/popup.gd" id="26_pm647"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_mh75v"]
|
||||
@@ -174,7 +175,6 @@ grow_vertical = 2
|
||||
|
||||
[node name="KeyboardSpacer" parent="." instance=ExtResource("13_6pvxs")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
|
||||
[node name="LoginForm" type="Control" parent="KeyboardSpacer"]
|
||||
@@ -328,6 +328,16 @@ unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "INVALID_EMAIL_OR_PASSWORD"
|
||||
label_settings = ExtResource("24_y5bcl")
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="ResetPasswordButton" type="Button" parent="KeyboardSpacer/LoginForm/LoginFormValidator/FormContainer"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 8
|
||||
theme_override_font_sizes/font_size = 70
|
||||
text = "RESET_PASSWORD"
|
||||
|
||||
[node name="Register" type="Button" parent="KeyboardSpacer/LoginForm/LoginFormValidator/FormContainer"]
|
||||
layout_mode = 2
|
||||
@@ -507,6 +517,7 @@ text = "CANCEL"
|
||||
[connection signal="logged_in" from="KeyboardSpacer/LoginForm" to="." method="_on_login_in"]
|
||||
[connection signal="item_selected" from="KeyboardSpacer/LoginForm/LoginFormValidator/FormContainer/LanguageContainer/LanguageField" to="KeyboardSpacer/LoginForm/LoginFormValidator/FormContainer/LanguageContainer/LanguageField" method="_on_item_selected"]
|
||||
[connection signal="pressed" from="KeyboardSpacer/LoginForm/LoginFormValidator/FormContainer/ValidateButton" to="KeyboardSpacer/LoginForm" method="_on_validate_button_pressed"]
|
||||
[connection signal="pressed" from="KeyboardSpacer/LoginForm/LoginFormValidator/FormContainer/ResetPasswordButton" to="KeyboardSpacer/LoginForm" method="_on_reset_password_button_pressed"]
|
||||
[connection signal="pressed" from="KeyboardSpacer/LoginForm/LoginFormValidator/FormContainer/Register" to="." method="_on_register_pressed"]
|
||||
[connection signal="pressed" from="InterfaceLeft/Container/BackButton" to="." method="_on_back_button_pressed"]
|
||||
[connection signal="pressed" from="NoInternetPopup/TextureRect/PanelContainer/VBoxContainer/MarginContainer/VBoxContainer/HBoxContainer/ConfirmButton" to="NoInternetPopup" method="_on_confirm_button_pressed"]
|
||||
|
||||
@@ -6,6 +6,7 @@ signal internet_check_completed(has_access: bool)
|
||||
|
||||
const INTERNET_CHECK_URL: String = "https://google.com"
|
||||
const AWS_API_GATEWAY_ADRESS: String = "https://xwvmrarnb7.execute-api.eu-west-3.amazonaws.com"
|
||||
const AWS_PASSWORD_RESET_ADRESS: String = "https://10g8bfw6c3.execute-api.eu-west-3.amazonaws.com/dev/"
|
||||
|
||||
# Response from the last request
|
||||
var success: bool
|
||||
@@ -93,6 +94,14 @@ func login(mail: String, password: String) -> Dictionary:
|
||||
return _response()
|
||||
|
||||
|
||||
func reset_password(mail: String) -> Dictionary:
|
||||
var previous: String = environment_url
|
||||
environment_url = AWS_PASSWORD_RESET_ADRESS
|
||||
await _post_json_request("forgot", {"email": mail})
|
||||
environment_url = previous
|
||||
return _response()
|
||||
|
||||
|
||||
func delete_account() -> Dictionary:
|
||||
loading_rect.show()
|
||||
await _delete_request("delete_account")
|
||||
|
||||
Reference in New Issue
Block a user