Skip to content
Snippets Groups Projects
Commit 12c7762b authored by Milo Hivert's avatar Milo Hivert
Browse files

version vm

parent 0715d858
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -70,7 +70,7 @@ function f (){
paraph.classList.add("text_box");
}
if (adresse!=="" && somme >0 && somme <= 40 ){
window.location = "http://localhost:8000/mes_commandes/"+nature+"_"+nutella+"_"+sucre+"_"+fraise+"_"+abricot+"_"+adresse+"_";
window.location = "https://astegifetobegif.cs-campus.fr/mes_commandes/"+nature+"_"+nutella+"_"+sucre+"_"+fraise+"_"+abricot+"_"+adresse+"_";
}
}
}
......
......@@ -28,13 +28,13 @@ def decryptmess(message):
def connexion(request):
return HttpResponseRedirect('https://auth.viarezo.fr/oauth/authorize/?redirect_uri=http://localhost:8000&client_id=2fe828e15647fc92437727b6646ce5c799c40991&response_type=code&state=sqdkfjhsqdkf&scope=default')
return HttpResponseRedirect('https://auth.viarezo.fr/oauth/authorize/?redirect_uri=https://astegifetobegif.cs-campus.fr/intermediaire&client_id=2fe828e15647fc92437727b6646ce5c799c40991&response_type=code&state=sqdkfjhsqdkf&scope=default')
def login(request): #on a le state et le authorization code dans le request
code = str(request.GET['code']),
state = str(request.GET['state'])
url = 'https://auth.viarezo.fr/oauth/token'
redirect_url = 'http://localhost:8000'
redirect_url = 'https://astegifetobegif.cs-campus.fr/intermediaire'
jso = requests.post(url, data={'grant_type':'authorization_code','code':code,'redirect_uri':redirect_url,'client_id':'2fe828e15647fc92437727b6646ce5c799c40991','client_secret':'f306614fc96833e80af693f2991901bc54a9cf9a'}).json()
access_token = jso['access_token']
r = requests.get("https://auth.viarezo.fr/api/user/show/me", headers={"Authorization" : "Bearer "+access_token})
......
No preview for this file type
......@@ -24,7 +24,7 @@ SECRET_KEY = 'django-insecure-^pwp$p=!_g7hoyl&1kul+!v(!y9lu+6@-+1d_&auub18m^h@w(
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = False
ALLOWED_HOSTS = ["138.195.139.213", "localhost", "astegifetobegif.cs-campus.fr", "*"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment