forked from mtusi2026/mtusi2026lab2
31 lines
601 B
Plaintext
31 lines
601 B
Plaintext
meta {
|
||
name: Revoked token is rejected
|
||
type: http
|
||
seq: 2
|
||
}
|
||
|
||
get {
|
||
url: {{baseUrl}}/api/v1/users/me
|
||
body: none
|
||
auth: none
|
||
}
|
||
|
||
headers {
|
||
Authorization: Bearer {{token}}
|
||
}
|
||
|
||
docs {
|
||
Повторное использование отозванного токена: 401 с Bearer-challenge.
|
||
Ожидаемый результат после logout-current-session.
|
||
}
|
||
|
||
tests {
|
||
test("401 unauthorized", function() {
|
||
expect(res.status).to.equal(401);
|
||
});
|
||
|
||
test("Bearer challenge", function() {
|
||
expect(res.headers["www-authenticate"]).to.equal('Bearer realm="messenger"');
|
||
});
|
||
}
|