bluedither 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,24 +22,23 @@ export default async function login(args) {
22
22
 
23
23
  return new Promise((resolvePromise, reject) => {
24
24
  const server = createServer(async (req, res) => {
25
- if (req.method === 'POST' && req.url === '/callback') {
26
- let body = '';
27
- req.on('data', chunk => { body += chunk; });
28
- req.on('end', () => {
29
- try {
30
- const creds = JSON.parse(body);
31
- saveCredentials(creds);
32
- res.writeHead(200, { 'Content-Type': 'application/json' });
33
- res.end('{"ok":true}');
34
- console.log('\n ✓ Logged in successfully!\n');
35
- server.close();
36
- resolvePromise();
37
- } catch (err) {
38
- res.writeHead(400);
39
- res.end();
40
- reject(err);
41
- }
42
- });
25
+ const url = new URL(req.url, `http://localhost`);
26
+ if (url.pathname === '/callback') {
27
+ try {
28
+ const access_token = url.searchParams.get('access_token');
29
+ const refresh_token = url.searchParams.get('refresh_token');
30
+ if (!access_token) throw new Error('No token received');
31
+ saveCredentials({ access_token, refresh_token });
32
+ res.writeHead(200, { 'Content-Type': 'text/html' });
33
+ res.end('<html><body style="background:#0a0a0f;color:#e4e4ef;font-family:system-ui;display:flex;align-items:center;justify-content:center;height:100vh;margin:0"><h1>Logged in! You can close this tab.</h1></body></html>');
34
+ console.log('\n ✓ Logged in successfully!\n');
35
+ server.close();
36
+ resolvePromise();
37
+ } catch (err) {
38
+ res.writeHead(400);
39
+ res.end('Login failed');
40
+ reject(err);
41
+ }
43
42
  } else {
44
43
  res.writeHead(404);
45
44
  res.end();
@@ -55,9 +54,13 @@ export default async function login(args) {
55
54
 
56
55
  // Open browser
57
56
  import('child_process').then(({ exec }) => {
58
- const cmd = process.platform === 'win32' ? 'start' :
59
- process.platform === 'darwin' ? 'open' : 'xdg-open';
60
- exec(`${cmd} "${loginUrl}"`);
57
+ if (process.platform === 'win32') {
58
+ exec(`start "" "${loginUrl}"`);
59
+ } else if (process.platform === 'darwin') {
60
+ exec(`open "${loginUrl}"`);
61
+ } else {
62
+ exec(`xdg-open "${loginUrl}"`);
63
+ }
61
64
  });
62
65
 
63
66
  // Timeout after 5 minutes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bluedither",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "A bold, dithered-shader hero theme for Claude Code — skill + fine-tuner",
5
5
  "type": "module",
6
6
  "bin": {