Skip to content

Replace User Context with User machine #434

Closed

Description

@presleyp

In accordance with https://www.notion.so/coderhq/v2-Frontend-State-Management-APPROVED-e5ccb3c6357649f9a9dc1a1b2a1b7a99, we will use a machine to encapsulate API calls about the current user and hold user state.

  • replace UserContext with userMachine
  • refactor all checks for authentication
  • refactor SignInPage to use userMachine

Requirements:
Given a current user created in the database,

  • user can log in
  • user can log out
  • logged in user can view pages that require authentication
  • logged out user cannot view pages that require authentication, and is redirected to /login. Upon logging in, the user is returned to the page they were trying to access.
  • logged out user can view /login and 404 page

Activity

  1. added this to the V2 Beta milestone on Mar 14, 2022
  2. self-assigned this
    on Mar 14, 2022
  3. presleyp commented on Mar 14, 2022

    @presleyp
    ContributorAuthor

    Closing as duplicate

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions