Title: Replace User Context with User machine · Issue #435 · coder/coder · GitHub
Open Graph Title: Replace User Context with User machine · Issue #435 · coder/coder
X Title: Replace User Context with User machine · Issue #435 · coder/coder
Description: 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 ...
Open Graph Description: 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 ho...
X Description: 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 ho...
Opengraph URL: https://github.com/coder/coder/issues/435
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Replace User Context with User machine","articleBody":"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. \r\n\r\n- replace `UserContext` with `userMachine`\r\n- refactor all checks for authentication\r\n- refactor `SignInPage` to use `userMachine`\r\n\r\nRequirements:\r\nGiven a current user created in the database,\r\n- [x] user can log in\r\n- [x] user can log out\r\n- [x] logged in user can view pages that require authentication\r\n- [x] logged in user on /login gets redirected to /projects\r\n- [x] 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.\r\n- [x] logged out user can view /login and 404 page\r\n\r\nImplementation goals:\r\n- [x] install XState and related packages\r\n- [x] set up dev tools - half done, see #462 \r\n- [x] set up typegen - half done, see #456 \r\n- [x] replace user Context with user xservice\r\n- [x] use xservice only in glue components\r\n\r\nTesting goals:\r\n- [x] Storybook NavbarView\r\n- [x] Storybook SignInForm\r\n- [x] TBD mix of unit, integration, e2e tests to cover auth behavior","author":{"url":"https://github.com/presleyp","@type":"Person","name":"presleyp"},"datePublished":"2022-03-14T17:46:55Z","url":"https://github.com/coder/coder/issues/435"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:14304109-5640-d13e-4884-3342e9fc48b9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 980A:296654:18B0EA7:20ECC60:6B014BC3 |
| html-safe-nonce | 429f6843d4a9882879dd376ff057511542c75103e8f7fe7cfed7ace055177972 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODBBOjI5NjY1NDoxOEIwRUE3OjIwRUNDNjA6NkIwMTRCQzMiLCJ2aXNpdG9yX2lkIjoiNTkyMDYzODkwMjA5OTU5NDE3OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 62899127821110819915d02a97d614976c7d8cceaed7ad1806e1d8c8123a96c8 |
| hovercard-subject-tag | issue:1168712964 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/435/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2cc0b4a31d176288b6e1f29fbd3717520f1ac24b59bb06fd09dfc80fb82ec702/coder/coder/issues/435 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2cc0b4a31d176288b6e1f29fbd3717520f1ac24b59bb06fd09dfc80fb82ec702/coder/coder/issues/435 |
| og:image:alt | 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 ho... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | presleyp |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/coder git https://github.com/coder/coder.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 440752086 |
| octolytics-dimension-repository_nwo | coder/coder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 440752086 |
| octolytics-dimension-repository_network_root_nwo | coder/coder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width