update
This commit is contained in:
30
tournme/collection/PadelTour API/Authentication/Login.bru
Normal file
30
tournme/collection/PadelTour API/Authentication/Login.bru
Normal file
@@ -0,0 +1,30 @@
|
||||
meta {
|
||||
name: Login
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/v1/login
|
||||
body: formUrlEncoded
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
body:form-urlencoded {
|
||||
grant_type:
|
||||
username: {{username}}
|
||||
password: {{password}}
|
||||
scope:
|
||||
client_id:
|
||||
client_secret:
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
function onResponse(res) {
|
||||
let data = res.getBody();
|
||||
bru.setEnvVar("access_token", data.access_token);
|
||||
bru.setEnvVar("refresh_token", data.refresh_token);
|
||||
}
|
||||
|
||||
onResponse(res);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
meta {
|
||||
name: Refresh Token
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/v1/refresh
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"refresh_token": "{{refresh_token}}"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
meta {
|
||||
name: Authentication
|
||||
}
|
||||
Reference in New Issue
Block a user