Skip to content

Commit

Permalink
oauth reject responds with empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
gedaiu committed Feb 28, 2019
1 parent 182919f commit 1dd98b4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/vibeauth/router/oauth.d
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ class OAuth2: BaseAuthRouter {
/// Handle the OAuth requests. Handles token creation, authorization
/// authentication and revocation
void tokenHandlers(HTTPServerRequest req, HTTPServerResponse res) {

try {
setAccessControl(res);
if(req.method == HTTPMethod.OPTIONS) {
Expand Down Expand Up @@ -437,6 +438,9 @@ class OAuth2: BaseAuthRouter {

auto const token = req.form["token"];
collection.revoke(token);

res.statusCode = 200;
res.writeBody("");
}


Expand Down Expand Up @@ -560,7 +564,7 @@ unittest {

void showAuth(HTTPServerRequest req, HTTPServerResponse res) {
res.statusCode = 200;
string hasEmail = "email" in req.context ? "yes" : "no";
string hasEmail = "email" in req.context ? "yes" : "no";
res.writeBody(req.username ~ ":" ~ req.password ~ ":" ~ hasEmail);
}

Expand Down

0 comments on commit 1dd98b4

Please sign in to comment.