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

refactor: add isAnonymous property to auth state #4229

Merged
merged 4 commits into from
Jun 27, 2024

Conversation

Schwehn42
Copy link
Collaborator

Description

This PR adds a new property isAnonymous to the Auth state. This is required by #4201 to differentiate between users that registered anonymously or using one of the providers (Google, Apple, etc).
The reason I didn't just add accountType to the Auth interface is that I think it's easier to handle a boolean than a string, anticipating that this might be used at more than one place.

Changelog

  • types/auth.ts:
    • Add isAnonymous prop to Auth interface
    • Add new interface AuthDto resembling the actual json retrieved from backend, which was omitted until now.
  • api/auth.ts
    • getCurrentUser(): Cast as AuthDto, as this includes the accountType property
  • middleware/auth.tsx
    • set isAnonymous to whether the account is anonymous
  • Add isAnonymous prop to other files depending on Auth interface, like getTestApplicationState

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

(Optional) Visual Changes

@Schwehn42 Schwehn42 added the Review Needed This pull request is ready for review label Jun 17, 2024
@Schwehn42 Schwehn42 self-assigned this Jun 17, 2024

This comment has been minimized.

src/types/auth.ts Show resolved Hide resolved
@Schwehn42 Schwehn42 enabled auto-merge June 27, 2024 16:30
@Schwehn42 Schwehn42 removed the Review Needed This pull request is ready for review label Jun 27, 2024
@Schwehn42 Schwehn42 added this pull request to the merge queue Jun 27, 2024
Copy link

The deployment to the dev cluster was successful. You can find the deployment here: https://4229.development.scrumlr.fra.ics.inovex.io
This deployment is only for testing purposes and will be deleted after 1 week.
To redeploy rerun the workflow.
DO NOT STORE IMPORTANT DATA ON THIS DEPLOYMENT

Deployed Images
  • ghcr.io/inovex/scrumlr.io/scrumlr-frontend:sha-9c915da

  • ghcr.io/inovex/scrumlr.io/scrumlr-server:sha-9c915da

Merged via the queue into main with commit 6aba47e Jun 27, 2024
7 checks passed
@Schwehn42 Schwehn42 deleted the js/user-auth-type-is-anonymous branch June 27, 2024 16:38
Copy link

octomind-dev bot commented Jun 27, 2024

🐙 Octomind

Test Report: 13/14 successful.

description status details
About Section Visibility Test Passed ✅ click
change avatar Passed ✅ click
check Privacy Policy Passed ✅ click
check terms & conditions Passed ✅ click
close cookie banner - front page Passed ✅ click
close cookie banner - sign-in Passed ✅ click
create and delete board columns Passed ✅ click
create_and_delete_notes_and_actions_v2 Passed ✅ click
create lean coffee board Passed ✅ click
edit_notes_and_actions_v5 Passed ✅ click
get started Passed ✅ click
share_session Passed ✅ click
sign-in Passed ✅ click
test all ways to open the setup flow Failed ❌ click

commit sha: 9c915da

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants