We will need to pass the source field to the keyserver to distinguish between different log-in scenarios (task).
This diff adds this field to the strict interface but allows an undefined source (which will happens on logging from the login form).
A proper type for login from form will be added later on and this field will become mandatory.
Details
Details
- Modify the code to pass the source field.
- Check if validation pass for both undefined (e.g. login from form) and defined source (e.g. cookie expired).
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
Comment Actions
I think the LogInRequest type should've also been updated, but that can be done in a later diff.
You don't need to use React.useMemo(...) here.
The useMemo() hook is helpful for maintaining referential equality so that objects will be considered "shallowly equal" (== in JS) and we can avoid re-renders. This is helpful for objects (including Map(), Set(), etc), arrays (which are objects), and functions (which are objects).
On the other hand, strings in JS are considered shallowly equal if they have the same contents, so we don't have to worry about re-renders if the "content" stays the same.
See below:
(In like C++, which you've been working w/ recently, std::strings can be allocated on the heap (unlike integers, booleans, etc) which may have been part of your reasoning that shallow equality would check reference instead of contents?)