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

feat(gql): indicate whether user password needs reset #4514

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,7 @@ type UMAPPoints {
type User implements Node {
"""The Globally Unique ID of this object"""
id: GlobalID!
passwordNeedsReset: Boolean!
email: String!
username: String
createdAt: DateTime!
Expand Down
2 changes: 2 additions & 0 deletions src/phoenix/server/api/types/User.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@strawberry.type
class User(Node):
id_attr: NodeID[int]
password_needs_reset: bool
email: str
username: Optional[str]
created_at: datetime
Expand Down Expand Up @@ -45,6 +46,7 @@ def to_gql_user(user: models.User, api_keys: Optional[List[models.ApiKey]] = Non
"""
return User(
id_attr=user.id,
password_needs_reset=user.reset_password,
username=user.username,
email=user.email,
created_at=user.created_at,
Expand Down
Loading