这是indexloc提供的服务,不要输入任何密码
Skip to content

Stuck on spinning with a Oauth user without email #6874

@kzhou57

Description

@kzhou57

Please note that security bugs or issues should be reported to security@pgadmin.org.

Describe the bug

When a user from oauth login, it might not have an email field, if in this case, after login, the page will stuck and keep spinning.

In the error log, we see

   File "/usr/pgadmin4/web/pgadmin/tools/user_management/__init__.py", line 106, in current_user_info
    email=current_user.email.replace("'","\\\\'"),
AttributeError: 'NoneType' object has no attribute 'replace'

It seems it's a regression of latest release 7.8, it's not reproducible at 7.7.

And I believe this long is the problem ,

email=current_user.email.replace("'","\\'"),

To Reproduce

Steps to reproduce the behavior:

  1. Setup an oauth authentication without email, for example : github and set OAUTH2_USERNAME_CLAIM : login
  2. Click on Login with github button
  3. After been redirected /borrow/ page, the page is stuck.

Expected behavior

Login successfully.

Error message

Spinning.

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Windows 10, OSX monterey]
  • Version: 7.8
  • Mode: Server / Web
  • Browser (if running in server mode): [e.g. chrome, safari]
  • Package type: [e.g. RPM, DEB, Python, Container, etc.]

Additional context

Add any other context about the problem here.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions