securegate-cli-tool 2.1.1 → 2.1.3
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.
- package/package.json +1 -1
- package/src/commands/login.js +6 -7
- package/src/config.js +1 -1
package/package.json
CHANGED
package/src/commands/login.js
CHANGED
|
@@ -98,16 +98,15 @@ async function loginCommand() {
|
|
|
98
98
|
// We must fetch the user profile securely given the access token
|
|
99
99
|
spinner.text = 'Verifying session...';
|
|
100
100
|
|
|
101
|
-
//
|
|
102
|
-
// We manually overwrite the globally configured client to bypass normal auth requirement
|
|
101
|
+
// Create a minimal Supabase client for auth verification only
|
|
103
102
|
const { createClient } = require('@supabase/supabase-js');
|
|
104
|
-
|
|
105
|
-
auth: { persistSession: false }
|
|
106
|
-
global: { headers: { Authorization: `Bearer ${payload.access_token}` } }
|
|
103
|
+
const supabaseAuth = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, {
|
|
104
|
+
auth: { persistSession: false }
|
|
107
105
|
});
|
|
108
106
|
|
|
109
|
-
//
|
|
110
|
-
|
|
107
|
+
// Pass the JWT directly to getUser() — this is the correct server-side pattern
|
|
108
|
+
// It tells Supabase to verify this specific token rather than looking for a session
|
|
109
|
+
const { data: { user }, error } = await supabaseAuth.auth.getUser(payload.access_token);
|
|
111
110
|
|
|
112
111
|
if (error || !user) {
|
|
113
112
|
console.error("\n[DEBUG] getUser failed:", { error, user, access_token: payload.access_token.substring(0, 15) + '...' });
|
package/src/config.js
CHANGED
|
@@ -15,7 +15,7 @@ const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
|
|
15
15
|
// SecureGate uses strict Row Level Security (RLS) with no policies, meaning this key
|
|
16
16
|
// CANNOT read or write any database data. It is strictly used for the login flow.
|
|
17
17
|
const SUPABASE_URL = 'https://pbrmsfoowrjqsikgkijb.supabase.co';
|
|
18
|
-
const SUPABASE_ANON_KEY = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
|
|
18
|
+
const SUPABASE_ANON_KEY = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InBicm1zZm9vd3JqcXNpa2draWpiIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzAzNjU0NjIsImV4cCI6MjA4NTk0MTQ2Mn0.XfZyEv3atJp7BMH7oQKx1T-rrP_8PLTKeyoIfvUgLks';
|
|
19
19
|
|
|
20
20
|
// Public-facing proxy URL
|
|
21
21
|
const PROXY_BASE_URL = 'https://usesecuregate.xyz/v1';
|