Skip to content

Commit 4c266d6

Browse files
Add advanced scope management to authproto (#46)
* cool changes to authproto (add scopes) * Add scopes example * Polish one itty bitty test detail * CI pls * oops * real package lock
1 parent 73e2ef5 commit 4c266d6

51 files changed

Lines changed: 9752 additions & 304 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
"@fujocoded/authproto": minor
3+
---
4+
5+
Add scoped login controls, an Authorize component for requesting extra
6+
permissions after login, and helpers for building ATProto permission scopes.
7+
8+
## Breaking changes
9+
10+
- Login and logout now default to returning users to the referring page instead
11+
of `/`. Set `redirects.afterLogin` and `redirects.afterLogout` to `/` to keep
12+
the old behavior.
13+
- `<Login />` no longer defaults the input placeholder to `handle.bsky.social`;
14+
pass `placeholder="handle.bsky.social"` if you want that exact prompt.
15+
- `Astro.locals.loggedInUser` now includes a required `scopes` array. Update
16+
tests, mocks, and custom local assignments to include `scopes: []` when no
17+
grants are needed.

.github/workflows/scripts/first-release-publish.mjs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { spawnSync } from "node:child_process";
55
const npmToken = process.env.NODE_AUTH_TOKEN ?? process.env.NPM_TOKEN;
66

77
if (!npmToken) {
8-
console.error("NODE_AUTH_TOKEN or NPM_TOKEN is required for first package releases.");
8+
console.error(
9+
"NODE_AUTH_TOKEN or NPM_TOKEN is required for first package releases.",
10+
);
911
process.exit(1);
1012
}
1113

@@ -109,12 +111,16 @@ for (const pkg of missingPackages) {
109111
process.exit(whoami.status ?? 1);
110112
}
111113

112-
const result = spawnSync("npm", ["publish", "--provenance", "--access", "public"], {
113-
cwd: pkg.dir,
114-
encoding: "utf8",
115-
env: { ...process.env, NODE_AUTH_TOKEN: npmToken, NPM_TOKEN: npmToken },
116-
stdio: ["inherit", "pipe", "pipe"],
117-
});
114+
const result = spawnSync(
115+
"npm",
116+
["publish", "--provenance", "--access", "public"],
117+
{
118+
cwd: pkg.dir,
119+
encoding: "utf8",
120+
env: { ...process.env, NODE_AUTH_TOKEN: npmToken, NPM_TOKEN: npmToken },
121+
stdio: ["inherit", "pipe", "pipe"],
122+
},
123+
);
118124

119125
process.stdout.write(result.stdout);
120126
process.stderr.write(result.stderr);
@@ -133,7 +139,9 @@ for (const pkg of missingPackages) {
133139
process.stderr.write(tag.stderr);
134140

135141
if (tag.status !== 0) {
136-
console.error(`${pkg.name} was published, but git tag ${tagName} could not be created.`);
142+
console.error(
143+
`${pkg.name} was published, but git tag ${tagName} could not be created.`,
144+
);
137145
process.exit(tag.status ?? 1);
138146
}
139147

0 commit comments

Comments
 (0)