import streamlit as st import requests import os tok=os.getenv("TOK") def REGISTER(): with st.container(border=True): with st.form("register_form"): st.text("Account Activation") name=st.text_input("name of the organization ( lab,pharma) ?") operation=st.text_area("primary operation of the organization ? ") username=st.text_input("setup a username") password=st.text_input("setup a password") register_button=st.form_submit_button("Register") if register_button: response=requests.post("https://thexforce-combat-backend.hf.space/registerorg",json={ "name":name, "operation":operation, "username":username, "password":password },headers={ "Content-Type":"application/json", "Authorization":f"Bearer {tok}" }) jsonresponse=response.json() if jsonresponse.get("status") == True: st.badge("Success", icon=":material/check:", color="green") #st.session_state.registered=True #st.rerun() elif jsonresponse.get("status") == False: st.error("ERROR while registering......")