Skip to content
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

feat(createInsightsMiddleware): support authenticatedUserToken #5997

Merged
merged 6 commits into from
Jan 16, 2024

Conversation

sarahdayan
Copy link
Member

@sarahdayan sarahdayan commented Jan 13, 2024

This supports the new authenticatedUserToken from Search Insights.

When provided, it takes precedence over the userToken. When not, or when unset, the userToken is used.

Note

The code and tests are getting a bit more complicated than they could, but I didn't want to make a refactor in this PR to avoid complexifying the diffs. I'll do it in a separate one.

https://algolia.atlassian.net/browse/FX-2707

@sarahdayan sarahdayan marked this pull request as draft January 13, 2024 17:23
Copy link

codesandbox-ci bot commented Jan 13, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 4802b7b:

Sandbox Source
InstantSearch.js Configuration
react-instantsearch-app Configuration
example-react-instantsearch-default-theme Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-vue-instantsearch-default-theme Configuration

@sarahdayan sarahdayan force-pushed the feat/authenticated-user-token branch from f82b8c7 to 3cc7d0c Compare January 13, 2024 17:48
Comment on lines +274 to +276
const tokenBeforeInit =
authenticatedUserTokenBeforeInit || userTokenBeforeInit;
const queuedToken = queuedAuthenticatedUserToken || queuedUserToken;
Copy link
Member Author

Choose a reason for hiding this comment

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

This all could be simpler but it can be tackled in a separate refactoring PR.

@sarahdayan sarahdayan marked this pull request as ready for review January 15, 2024 15:52
@sarahdayan sarahdayan requested review from Haroenv and dhayab January 16, 2024 14:51
Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

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

refactor can be later

@sarahdayan sarahdayan merged commit a20715c into master Jan 16, 2024
3 checks passed
@sarahdayan sarahdayan deleted the feat/authenticated-user-token branch January 16, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants