Error creating user: [Error: AppwriteException: User (role: guests) missing scope (account)]
- 1
- React Native
- Auth

Currently having a problem. I am stuck here, I do not know how to progress my capstone with this error. Please help me guys

How do I resolve the issue and allow the guest users to create accounts?



The main context of my system is, an emergency app that will allow students to report emergencies in our school. Students the primary user they are has no accounts, only the emergency officers will have an account. If Student wants to be an emergency officer, he/she then will register an account and if you're successfully created an account, emergency officer will receive notifications of the emergency

The problem right now is, I cannot create an account because it says this error Error creating user: [Error: AppwriteException: User (role: guests) missing scope (account)]

the sdk for react native

Client side or server side sdk ? for performing create operation?

client side

probably figure out what the role & permissions setting options are needed for your use case in client side operation

im doing my CRUD operation on user through server side node-appwrite sdk, im too on figuring out to do things in right way my app

alright, thank you for your time and answer good sir

Did you managed to solve it?

What are your permissions set to?

Also, are you logged in?

not yet, I am still very new to this, sorry

I made my permission to set all user and guest has the ability to crud, just for testing. But to no avail, it still not working apparently

my sign-up.jsx
import { Alert, View, Text, SafeAreaView, ScrollView } from 'react-native';
import { router } from 'expo-router';
import { createUser } from '../../lib/appwrite';
import FormField from '../../components/FormField';
import CustomButton from '../../components/CustomButton';
const SignUp = () => {
const [form, setForm] = useState({
name: '',
email: '',
password: ''
});
const [isSubmitting, setisSubmitting] = useState(false);
const submit = async () => {
if (!form.name || !form.email || !form.password) {
Alert.alert('Error', 'Please fill in all the fields');
return;
}
setisSubmitting(true);
try {
const result = await createUser(form.email, form.password, form.name);
//set it to global state ...
console.log('User created:', result);
router.replace('/menu');
} catch (error) {
Alert.alert('Error', error.message);
} finally {
setisSubmitting(false);
}
}
return (
<SafeAreaView className="bg-white h-full">
<ScrollView>
//wont show the code here, its just the buttons and text fields
export default SignUp;

my sign-in
import { Alert, View, Text, SafeAreaView, ScrollView } from 'react-native';
import { router } from 'expo-router';
import { signIn } from '../../lib/appwrite';
import FormField from '../../components/FormField';
import CustomButton from '../../components/CustomButton';
const SignIn = () => {
const [form, setform] = useState({
email: '',
password: ''
});
const [isSubmitting, setisSubmitting] = useState(false);
const submit = async () => {
if (!form.email || !form.password) {
Alert.alert('Error', 'Please fill in all the fields');
return;
}
setisSubmitting(true);
try {
await signIn(form.email, form.password);
router.replace('/SERTemergency');
} catch (error) {
Alert.alert('Error', error.message);
} finally {
setisSubmitting(false);
}
}
return (
<SafeAreaView className="bg-white h-full">
<ScrollView>
<View className="w-full justify-center min-h-[85vh] px-4 my-6">
<Text className="text-2xl text-black text-semibold mt-10 font-psemibold">Sign In!</Text>
//wont show the code here, its just the buttons and text fields
export default SignIn;

I hope someone can help me
Recommended threads
- Email Verification Email
Hi everyone, I’m currently experiencing an issue with the email verification functionality. When I trigger the verification, the request returns a valid respon...
- Persistent 401 Unauthorized on all authe...
Hello, I'm facing a critical 401 Unauthorized error on my admin panel app and have exhausted all debugging options. The Problem: When my React app on localhos...
- Google Oauth help
this error pops up (TypeError: (0 , {imported module [project]/src/lib/auth.ts [app-rsc] (ecmascript)}.signIn) is not a function) but cant find a way to solve i...
