Can I override the user interface, and the signUp ...
# support-questions
t
Can I override the user interface, and the signUp function?
Copy code
/* 
    * Called to sign-up a new user
    * 
    * @params: email
    *          password
    * 
    * @returns: "OK": on successfully signing up the user
    *           "EMAIL_ALREADY_EXISTS_ERROR": if the email is already been used
    */
    signUp(input: {
        email: string;
        password: string;
    }): Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>;
r
What do you mean? Can you please elaborate?
t
I just want to add another column in the emailpassword_users table
is that possible?
r
You should add that to your own db against the user ID.
t
thanks for ur answer but I'm trying to add a column named 'role' , so after getting ur answer I think I ended up with 2 solutions to my situation: 1- Considering the 'role' as a computed attribute , I'll have to query each role table in order to find the role of the user as follows
Copy code
teacher = await prisma.teacherAccount.findMany({where : {userId : userId});
if teacher !== [] : {teacher.role = "teacher"; return teacher;}
student = await prisma.studentAccount.findMany({where : {userId : userId});
if student !== [] : {student.role = "student"; return student;}
admin = await prisma.adminAccount.findMany({where : {userId : userId});
if admin !== [] : {admin.role = "admin"; return admin;}
2- Creating another "account" table that stores shared columns (username, phone number etc...) between the users AND the role column, also creating relation tables for each role between "account" and the associated role table because we can have columns specific for each role. Which option do you recommend for this case?
I added a new column in the table userpassword_users which fixed most of my problems
is it safe to do that?
r
You added this table to our postgresql db? form the dev env?
you can do that, however, you won't have access to the db for prod env.
So you might want to create your own db somewhere and make this table there
t
by "our" postgresql db you mean when using the hosting provided by supertokens?
im using self hosted for now
r
Yes. They one whose credentials are on the supertokens dashboard
t
alright!
2 Views