İlk commit: Stepstead Godot istemci (4.6 Mobile)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
commit
6a1706051d
346 changed files with 14415 additions and 0 deletions
28
scripts/register.gd
Normal file
28
scripts/register.gd
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
extends Control
|
||||
|
||||
@onready var email: LineEdit = $Panel/VBox/Email
|
||||
@onready var pw: LineEdit = $Panel/VBox/Password
|
||||
@onready var name_input: LineEdit = $Panel/VBox/DisplayName
|
||||
@onready var submit_btn: Button = $Panel/VBox/Submit
|
||||
@onready var back_btn: Button = $Panel/VBox/Back
|
||||
@onready var error: Label = $Panel/VBox/Error
|
||||
|
||||
func _ready() -> void:
|
||||
error.text = ""
|
||||
submit_btn.pressed.connect(_on_submit)
|
||||
back_btn.pressed.connect(func(): get_tree().change_scene_to_file("res://scenes/login.tscn"))
|
||||
|
||||
func _on_submit() -> void:
|
||||
error.text = ""
|
||||
submit_btn.disabled = true
|
||||
var res: Dictionary = await Auth.register(email.text.strip_edges(), pw.text, name_input.text.strip_edges())
|
||||
submit_btn.disabled = false
|
||||
if not res.ok:
|
||||
var detail := "Kayıt başarısız"
|
||||
if res.body is Dictionary and res.body.has("detail"):
|
||||
detail = str(res.body["detail"])
|
||||
error.text = detail
|
||||
return
|
||||
error.text = "Doğrulama e-postası gönderildi. Şimdi giriş yapabilirsin."
|
||||
await get_tree().create_timer(1.5).timeout
|
||||
get_tree().change_scene_to_file("res://scenes/login.tscn")
|
||||
Loading…
Add table
Add a link
Reference in a new issue