Assign Profiles


Sometimes you want to assign profiles to users to restrict access or to make user experience more efficient.

You can take a look at profiles at user guide for more details.

To make that possible automatically you need to allow signups to profile first

IMAGE (allow signup)

Then after signup your users or whenever you feel necessary, you can call window.Fouita.Profile.signup


<script>
 async function submit(){
  let res = await window.Fouita.Profile.signup("Profile Name")
  if(res.error){
    // signup error
    console.log(res.message)
    return
  }
 }
</script>

<!-- HTML to Trigger submit on click -->


You can also make your user switch between profiles if he is already a member (signed up or added manually)


<script>
 async function switchProfile(){
   let res = await window.Fouita.Profile.select("Profile Name")
   if(res.error){
     // signup error
     console.log(res.message)
     return
   }
 }
</script>

<!-- HTML to Trigger switchProfile on click -->