Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong return type in docstring for auth.create_custom_token() #139

Closed
crunk1 opened this issue Mar 18, 2018 · 0 comments · Fixed by #144
Closed

Wrong return type in docstring for auth.create_custom_token() #139

crunk1 opened this issue Mar 18, 2018 · 0 comments · Fixed by #144

Comments

@crunk1
Copy link

crunk1 commented Mar 18, 2018

Environment

  • Operating System version: Win 10
  • Firebase SDK version: firebase_admin 2.9.0
  • Library version: 2.9.0
  • Firebase Product: auth
  • Python version: 3.6.4

Problem

def create_custom_token(uid, developer_claims=None, app=None):
    """Builds and signs a Firebase custom auth token.
    Args:
      uid: ID of the user for whom the token is created.
      developer_claims: A dictionary of claims to be included in the token
          (optional).
      app: An App instance (optional).
    Returns:
      string: A token minted from the input parameters.
    Raises:
      ValueError: If input parameters are invalid.
    """
    token_generator = _get_auth_service(app).token_generator
    return token_generator.create_custom_token(uid, developer_claims)

The docstring says it returns a string, but in python 3, this actually returns a bytes type. https://github.com/firebase/firebase-admin-python/blob/master/firebase_admin/auth.py#L745 returns bytes from jwt.encode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant