Page MenuHomePhabricator

[lib] Handle logged in / logged out case in useGetIdentitySearchAuthMessage
ClosedPublic

Authored by will on Feb 29 2024, 9:29 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 11, 2:44 AM
Unknown Object (File)
Mon, Nov 11, 12:36 AM
Unknown Object (File)
Sun, Nov 10, 10:28 PM
Unknown Object (File)
Sun, Nov 10, 9:21 PM
Unknown Object (File)
Sun, Nov 10, 11:44 AM
Unknown Object (File)
Oct 15 2024, 7:01 AM
Unknown Object (File)
Oct 10 2024, 12:49 PM
Unknown Object (File)
Oct 10 2024, 11:47 AM
Subscribers

Details

Summary

This replaces the getAuthMetadata conditional (which wasn't necessary) with whether or not we're logged in. If we're not logged in,
we should return early with a null as to avoid checking the contents of the auth metadata

Downstream this will result in the IdentitySearchAuthMessage always being set to null, causing the identity search context to not initialize.
As users are not logged in, there shouldn't be any need to use identity search context anyway.

We also add a console log if the AuthMetadata is incomplete to notify devs as this shouldn't happen if we're logged in

Test Plan

Tested on local. Successfully returned a null IdentitySearchAuthMessage value. When logged out, there is no error message. When logged in, getting incomplete auth metadata console log message

Diff Detail

Repository
rCOMM Comm
Branch
identity-search-client
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

will retitled this revision from [lib] Replaces the getAuthmetadata conditional with loggedIn conditional to [lib] Handle logged in / logged out case in useGetIdentitySearchAuthMessage.Feb 29 2024, 9:33 AM
will edited the summary of this revision. (Show Details)
will edited the summary of this revision. (Show Details)
will requested review of this revision.Feb 29 2024, 9:45 AM

can we improve the test plan a little? we should check that if the user isn't logged in we don't get an error

lib/utils/identity-search-utils.js
31 ↗(On Diff #37711)
will marked an inline comment as done.
will edited the test plan for this revision. (Show Details)

authMetadata to auth message in console log

can we improve the test plan a little? we should check that if the user isn't logged in we don't get an error

tested and updated test plan. Should be all set

This revision is now accepted and ready to land.Feb 29 2024, 1:51 PM

what is IdentitySearchAccessToken? do you mean IdentitySearchAuthMessage?

what is IdentitySearchAccessToken? do you mean IdentitySearchAuthMessage?

yep. my bad