Login with UnityWebRequest

Hey guys, i try to make a login for a mmorpg and then read the datas to get datas like coins, level, exp from the database. Is my used code safe or is there a another solution ?

what if I later set a variable with the user id. so is it possible to reverse engineer this user id and change it to a value like 1 (Admin). then everyone can log in to any account…

My Code for the login and register.

using System.Collections;
using TMPro;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class Auth : MonoBehaviour
{
    [SerializeField] TMP_InputField username;
    [SerializeField] TMP_InputField password;
    [SerializeField] TMP_InputField password2;
    [SerializeField] TMP_InputField email;

    [SerializeField] TMP_Text status;

    [SerializeField] Button login;
    [SerializeField] Button register;

    [SerializeField] Button create;
    [SerializeField] Button back;



    void Start()
    {
        Switch("Login");

        login.onClick.AddListener(OnLogin);
        register.onClick.AddListener(OnRegister);
        create.onClick.AddListener(OnCreate);
        back.onClick.AddListener(OnBack);
    }

    void OnLogin() { StartCoroutine(Login()); }
    void OnRegister() { StartCoroutine(Register()); }

    void OnCreate() { Switch("Register"); }

    void OnBack() { Switch("Login"); }

    void Switch(string type)
    {
        status.text = "";
        if (type == "Login")
        {
            create.gameObject.SetActive(true);
            login.gameObject.SetActive(true);
            create.gameObject.SetActive(true);

            register.gameObject.SetActive(false);
            password2.gameObject.SetActive(false);
            email.gameObject.SetActive(false);
            back.gameObject.SetActive(false);
        }
        else if (type == "Register")
        {
            create.gameObject.SetActive(false);
            login.gameObject.SetActive(false);
            create.gameObject.SetActive(false);

            register.gameObject.SetActive(true);
            password2.gameObject.SetActive(true);
            email.gameObject.SetActive(true);
            back.gameObject.SetActive(true);
        }
    }

    IEnumerator Login()
    {
        WWWForm form = new WWWForm();
        form.AddField("username", username.text);
        form.AddField("password", password.text);

        using (UnityWebRequest www = UnityWebRequest.Post("http://localhost/login.php", form))
        {
            yield return www.SendWebRequest();

            if (www.result != UnityWebRequest.Result.Success)
            {
                Debug.Log(www.error);
                status.text = "Can't connect with the server.";
            }
            else
            {
                if (www.downloadHandler.text == "Success")
                {
                    SceneManager.LoadScene("Main");
                }
                else
                {
                    status.text = "Wrong username or password.";
                }

            }
        }
    }

    IEnumerator Register()
    {
        WWWForm form = new WWWForm();
        form.AddField("username", username.text);
        form.AddField("password", password.text);
        form.AddField("password2", password2.text);
        form.AddField("email", email.text);

        using (UnityWebRequest www = UnityWebRequest.Post("http://localhost/game/register.php", form))
        {
            yield return www.SendWebRequest();

            if (www.result != UnityWebRequest.Result.Success)
            {
                Debug.Log(www.error);
                status.text = "Error!";
            }
            else
            {
                if (www.downloadHandler.text == "Success")
                {
                    status.text = "Successfully!";
                }
                else
                {
                    status.text = "Error with the registration";
                }

            }
        }
    }
}