-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
Improve types around User Interactive Auth #4709
base: develop
Are you sure you want to change the base?
Conversation
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sensible. Could you update the PR title to be something that will make more sense in a changelog?
/** | ||
* Helper type to represent HTTP response body for a UIA enabled endpoint | ||
*/ | ||
export type UIAResponse<T> = T | IAuthData; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wondering if we should (temporarily) make this
/** @deprecated */
export type UIAResponse<T> = T;
... to avoid having to synchronise the EW and js-sdk PRs.
No strong feelings though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't need to synchronise them, EW can land first, shouldn't need to both land at once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually no, you're right, that is a better approach and will avoid a breaking change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
wrong link, I think |
export type UIAuthCallback<T> = (makeRequest: (authData: AuthDict | null) => Promise<UIAResponse<T>>) => Promise<T>; | ||
export type UIAuthCallback<T> = (makeRequest: (authData: AuthDict | null) => Promise<T>) => Promise<T>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice, while you're here (and since it took me a while to figure out), to clarify the documentation to say that, in the case of more auth being needed, makeRequest
will throw a MatrixError
whose data
conforms to IAuthData
. But I don't mind if you want to leave that for another time.
Fixes #4702
Requires element-hq/element-web#29255