File size: 481 Bytes
bc14969
629fd46
bc14969
629fd46
4de63e7
629fd46
 
 
 
bc14969
cfb5a4a
bc14969
cfb5a4a
629fd46
cfb5a4a
bc14969
cfb5a4a
bc14969
629fd46
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
import avaimet

def authenticate(username, password):
    usuarios = [("usuario1", "contrasena1"), ("usuario2", "contrasena2")]
    for u, p in usuarios:
        if username == u and password == p:
            return True
    return False

def getAccess(userfile):
    
    tokens = avaimet.do(userfile)
    
    return tokens

iface = gr.Interface(fn=getAccess, inputs="text", outputs="text")

#iface.launch()
iface.launch(auth=authenticate)