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

Change state.access structure #14

Merged
merged 1 commit into from
Apr 11, 2024
Merged

Change state.access structure #14

merged 1 commit into from
Apr 11, 2024

Conversation

Aupajo
Copy link
Member

@Aupajo Aupajo commented Apr 10, 2024

access could look like:

{
  denied: true,
  code: "not_allowed",
  reason: "Nobody's allowed to sign in on Tuesdays"
}

This leads to tests like this:

ok(access.denied)
strictEqual(access.reason, ...)

This changes the structure to:

{
  denied: { code: "...", reason: "..." }
}

and:

ok(access.denied)
strictEqual(access.denied.reason, ...)

@Aupajo Aupajo marked this pull request as ready for review April 10, 2024 02:14
@matt-wratt
Copy link
Member

I vote we close this in favour of #12

`access` could look like:

```ts
{
  denied: true,
  code: "not_allowed",
  reason: "Nobody's allowed to sign in on Tuesdays"
}
```

This leads to tests like this:

```ts
ok(access.denied)
strictEqual(access.reason, ...)
```

This changes the structure to:

```ts
{
  denied: { code: "...", reason: "..." }
}
```

and:

```ts
ok(access.denied)
strictEqual(access.denied.reason, ...)
```
@Aupajo Aupajo force-pushed the access-denied-state branch from 6128cd2 to 34189b5 Compare April 11, 2024 02:22
@Aupajo Aupajo merged commit 16e9652 into main Apr 11, 2024
1 check passed
@Aupajo Aupajo deleted the access-denied-state branch April 11, 2024 02:23
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