Back

Success but no new account created

  • 0
  • Flutter
tlamabc
29 Feb, 2024, 04:15

I created the login page and it worked fine until I created the sign_up page. The problem is that when I Signup it says success, but when I check Auth, the account is still not created. I searched on sources and documents. Hope you can take a look at the code and help me? import 'package:appwrite/appwrite.dart'; import 'package:flutter/material.dart'; import 'package:uuid/uuid.dart';

// Tạo một đối tượng UUID var uuid = Uuid();

// Tạo một chuỗi UUID duy nhất String userId = uuid.v4();

class SignupPage extends StatefulWidget { final Client? client;

SignupPage({Key? key, this.client}) : super(key: key);

@override _SignupPageState createState() => _SignupPageState(); }

class _SignupPageState extends State<SignupPage> { final TextEditingController _emailController = TextEditingController(); final TextEditingController _passwordController = TextEditingController(); final TextEditingController _nameController = TextEditingController();

Future<void> _signup() async { try { final email = _emailController.text; final password = _passwordController.text; final name = _nameController.text;

TypeScript
  print('Email: $email');
  print('Password: $password');
  print('Name: $name');
  print('UserId: $userId');

  final account = Account(widget.client ?? Client());
  // Loại bỏ tham số phone từ đây
  // await account.createPhoneSession(userId: userId, phone: phone);

  ScaffoldMessenger.of(context).showSnackBar(
    SnackBar(
      content: Text('Đăng ký thành công!'),
    ),
  );
} on AppwriteException catch (e) {
  print('Lỗi từ server: ${e.message}');
  ScaffoldMessenger.of(context).showSnackBar(
    SnackBar(
      content: Text('Đăng ký không thành công!'),
    ),
  );
}

}

TL;DR
Developers are encountering an issue where the signup process shows success but does not create a new account. The code for creating a phone session has the phone field removed, which may be causing the problem. The developer is seeking assistance in troubleshooting the issue. Solution: Review the code and ensure all necessary fields are included for creating a new account.
Steven
29 Feb, 2024, 04:17

Please use descriptive titles so people have an idea what your problem is.

Also, it's best to use 3 back ticks with multi-line code. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting

tlamabc
29 Feb, 2024, 04:19

Hello! Can anyone assist me? I have problem signing-up Auth (flutter).

tlamabc
29 Feb, 2024, 04:19

oki, thanks bro

Steven
29 Feb, 2024, 04:20

Success but no new account created

Steven
29 Feb, 2024, 04:22

This code is for creating a phone session and the API call is commented out

tlamabc
29 Feb, 2024, 04:22

Can you assist me, I'm new, I'm very grateful to you

tlamabc
29 Feb, 2024, 04:22

yes

tlamabc
29 Feb, 2024, 04:25

i removed the phone field but still not working

Steven
29 Feb, 2024, 04:25

What? What's your new code?

tlamabc
29 Feb, 2024, 04:29

this

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more