I'm new to Nuxt.js 3 and I couldn't find the reason why it is being prefix with 's'. Here is my code.
import { ISession } from "~/types/ISessions";
export async function registerWithEmail(
username: string,
name: string,
email: string,
password: string
) {
try {
const res = await $fetch<ISession>('/api/auth/register', {
method: 'POST',
body: { data: { username, name, email, password } }
})
if (res) {
useState('user').value = res
useState('userr').value = res
useState('xxx').value = res
await useRouter().push('/dashboard')
}
}
catch (e) {
// console.log('error' + e.toString())
}
}
In the console log when I check the state. It looks like this.