Skip to content

Commit

Permalink
Just redirect to app index for now
Browse files Browse the repository at this point in the history
  • Loading branch information
dianaclarke committed Aug 17, 2021
1 parent 354c422 commit 873fc55
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions conbench/api/_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ def validate(self, schema):

return data

def redirect(self, endpoint, **kwargs):
return f.redirect(f.url_for(endpoint, **kwargs))

def abort_400_bad_request(self, message):
if not isinstance(message, dict):
message = {"_errors": [message]}
Expand Down
4 changes: 2 additions & 2 deletions conbench/api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get(self):
---
description: Google SSO callback.
responses:
"204": "204"
"302": "302"
"400": "400"
tags:
- Authentication
Expand All @@ -105,7 +105,7 @@ def get(self):
}
user = User.create(data)
flask_login.login_user(user)
return self.response_204_no_content()
return self.redirect("app.index")
except:
self.abort_400_bad_request("Google SSO failed.")

Expand Down
2 changes: 1 addition & 1 deletion conbench/tests/api/_expected_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,7 @@
"get": {
"description": "Google SSO callback.",
"responses": {
"204": {"$ref": "#/components/responses/204"},
"302": {"$ref": "#/components/responses/302"},
"400": {"$ref": "#/components/responses/400"},
},
"tags": ["Authentication"],
Expand Down

0 comments on commit 873fc55

Please sign in to comment.