Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #253
In a few recent issues and PRs, I've noticed that we need to have access to the user's base domain (i.e.,
{username}.{root-domain}
). For example, @Genne23v needs it in #289.I've adjusted our code so that a
User
is a combination of a PrismaUser
(e.g., what is in the db), but also adds a dynamically generated property.baseDomain
, which is the user's base domain. ThisbaseDomain
is then available in the front-end using theuseUser()
hook.I have an example of how to use it by including it in the New Domain form, which we discussed in the early UI meetings:
Now a user only has to enter the first part of the name, and we build the rest for them.
I've also dealt with usernames including a
.
, and removed it. To make it easier to test this (until @cychu42 gets our db tests working in #238), I've updated the userhansolo
to behan.solo
. In the screenshot above, you can see that the.
was removed from the username. I've left the username untouched in the db, though, so it matches what Seneca has (i.e., I only remove the.
from the base domain we use for such a user).Tagging a few people for reviews, since this touches a bunch of back-end and front-end code.