-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom Google authentication handler with landing page
- Loading branch information
Showing
5 changed files
with
32 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from panel.auth import GoogleLoginHandler | ||
from panel.io.resources import CDN_DIST | ||
|
||
|
||
class CustomGoogleLoginHandler(GoogleLoginHandler): | ||
def _simple_get(self): | ||
html = self._login_template.render(errormessage="", PANEL_CDN=CDN_DIST) | ||
self.write(html) | ||
|
||
async def get(self): | ||
if "login" in self.request.uri and "state" not in self.request.uri: | ||
self._simple_get() | ||
else: | ||
await super().get() | ||
|
||
async def post(self): | ||
await super().get() |