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

add anonymous user middleware #2

Merged
merged 10 commits into from
Mar 3, 2022

Conversation

jorros
Copy link
Contributor

@jorros jorros commented Mar 1, 2022

No description provided.

Copy link
Contributor

@Kralizek Kralizek left a comment

Choose a reason for hiding this comment

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

Some changes and some general comments :)

src/AnonymousUser/AnonymousUserExtensions.cs Outdated Show resolved Hide resolved
"type": "process",
"args": [
"build",
"${workspaceFolder}/tests/AnonymousUserTests/AnonymousUserTests.csproj",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we target the whole solution instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not needed here, this is for debugging the code only.

src/AnonymousUser/AnonymousUser.csproj Outdated Show resolved Hide resolved
src/AnonymousUser/AnonymousUserMiddleware.cs Outdated Show resolved Hide resolved
src/AnonymousUser/AnonymousUserOptions.cs Show resolved Hide resolved
src/AnonymousUser/Base64CookieEncoder.cs Outdated Show resolved Hide resolved
tests/AnonymousUserTests/AnonymousUserTests.csproj Outdated Show resolved Hide resolved
tests/AnonymousUserTests/MoqAutoDataAttribute.cs Outdated Show resolved Hide resolved
src/AnonymousUser/AnonymousUserExtensions.cs Show resolved Hide resolved
Copy link
Contributor

@Kralizek Kralizek left a comment

Choose a reason for hiding this comment

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

99% done :) just check the comment I left regarding the nullability of the factory.


if (string.IsNullOrWhiteSpace(uid))
{
uid = _options.UserIdentifierFactory.Invoke(httpContext);
Copy link
Contributor

Choose a reason for hiding this comment

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

_options.UserIdentifierFactory could be null

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added a null reference check, although this case should be quite rare

@Kralizek Kralizek merged commit d5ba969 into insight-architectures:master Mar 3, 2022
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.

2 participants