Skip to content

Ease constraint on empty displayname #31

New issue

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

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

Already on GitHub? # to your account

Merged
merged 3 commits into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 1 addition & 3 deletions .github/workflows/fly.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: Fly Deploy
on:
release:
types: [published]
on: [workflow_dispatch]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized you cant actually manually trigger new workflows without this trigger explicitly defined

# push:
# branches:
# - main
Expand Down
7 changes: 4 additions & 3 deletions packages/todo0/src/server/controllers/oidc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ const verify = async (
}

// Ensure the profile response has the correct fields present to update or create a new user
if (!profile.displayName || !profile.emails) {
return done(new Error(`Invalid profile response: ${JSON.stringify(profile)}`));
if (!profile.emails) {
done(new Error(`Invalid profile response: ${JSON.stringify(profile)}`));
return;
}

try {
Expand All @@ -98,7 +99,7 @@ const verify = async (
org: { connect: { id: org.id } },
externalId: profile.id,
email: profile.emails![0].value,
name: profile.displayName,
name: profile.displayName ?? profile.emails[0]?.value
},
});
}
Expand Down
5 changes: 3 additions & 2 deletions packages/wiki0/src/server/controllers/oidc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ const verify = async (

if (!user) {
// Ensure the profile response has the correct fields present to update or create a new user
if (!profile.displayName || !profile.emails) {

if (!profile.emails) {
done(new Error(`Invalid profile response: ${JSON.stringify(profile)}`));
return;
}
Expand All @@ -97,7 +98,7 @@ const verify = async (
org: { connect: { id: org.id } },
externalId: profile.id,
email: profile.emails![0].value,
name: profile.displayName,
name: profile.displayName ?? profile.emails[0]?.value,
},
});
}
Expand Down