AIdeaText commited on
Commit
c626347
verified
1 Parent(s): 5fc7d23

Update modules/auth/auth.py

Browse files
Files changed (1) hide show
  1. modules/auth/auth.py +24 -0
modules/auth/auth.py CHANGED
@@ -167,7 +167,31 @@ def verify_password(stored_password, provided_password):
167
  stored_password.encode('utf-8')
168
  )
169
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  __all__ = [
 
171
  'create_auth_interface', # por 'authenticate_user',
172
  'authenticate_admin',
173
  'authenticate_student',
 
167
  stored_password.encode('utf-8')
168
  )
169
 
170
+ def create_user_page():
171
+ """
172
+ Crea una p谩gina de usuario simple para mostrar informaci贸n b谩sica tras el login.
173
+ """
174
+ with gr.Blocks() as user_page:
175
+ gr.Markdown("# Bienvenido a la User Page")
176
+ gr.Markdown("Esta p谩gina est谩 disponible solo despu茅s de un inicio de sesi贸n exitoso.")
177
+
178
+ # Mostrar informaci贸n del usuario
179
+ username = gr.Textbox(label="Usuario", interactive=False)
180
+ role = gr.Textbox(label="Rol", interactive=False)
181
+
182
+ def load_user_info():
183
+ # Cargar informaci贸n del usuario desde sesi贸n
184
+ return st.session_state.get("username", ""), st.session_state.get("role", "")
185
+
186
+ user_page.load(fn=load_user_info, inputs=[], outputs=[username, role])
187
+
188
+ # Bot贸n de logout
189
+ gr.Button("Cerrar Sesi贸n").click(fn=logout, inputs=[], outputs=[user_page])
190
+ return user_page
191
+
192
+
193
  __all__ = [
194
+ 'create_user_page',
195
  'create_auth_interface', # por 'authenticate_user',
196
  'authenticate_admin',
197
  'authenticate_student',