oauth-init 0.7.0 → 0.8.0
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/dist/index.js +13 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9171,13 +9171,12 @@ defineLazyProperty(apps, "safari", () => detectPlatformBinary({
|
|
|
9171
9171
|
var open_default = open;
|
|
9172
9172
|
|
|
9173
9173
|
// src/index.ts
|
|
9174
|
-
import { writeFile
|
|
9174
|
+
import { writeFile as writeFile2, unlink } from "fs/promises";
|
|
9175
9175
|
import path7 from "path";
|
|
9176
9176
|
import http from "http";
|
|
9177
|
-
|
|
9178
|
-
|
|
9179
|
-
|
|
9180
|
-
};
|
|
9177
|
+
|
|
9178
|
+
// src/lib/save-credentials.ts
|
|
9179
|
+
import { writeFile, readFile, access } from "fs/promises";
|
|
9181
9180
|
async function saveCredentials(clientId, clientSecret, provider, saveOption) {
|
|
9182
9181
|
const envKeyId = `${provider.toUpperCase()}_CLIENT_ID`;
|
|
9183
9182
|
const envKeySecret = `${provider.toUpperCase()}_CLIENT_SECRET`;
|
|
@@ -9215,6 +9214,12 @@ ${envKeySecret}=${clientSecret}`;
|
|
|
9215
9214
|
R2.success(`Credentials saved to ${envPath}`);
|
|
9216
9215
|
}
|
|
9217
9216
|
|
|
9217
|
+
// src/index.ts
|
|
9218
|
+
var globalConfig = {
|
|
9219
|
+
quiet: false,
|
|
9220
|
+
noOpen: false
|
|
9221
|
+
};
|
|
9222
|
+
|
|
9218
9223
|
class GoogleAuthProvider {
|
|
9219
9224
|
async run(_appName) {
|
|
9220
9225
|
try {
|
|
@@ -9389,7 +9394,7 @@ class GitHubAuthProvider {
|
|
|
9389
9394
|
</html>
|
|
9390
9395
|
`;
|
|
9391
9396
|
const tempPath = path7.join(process.cwd(), "github-setup.html");
|
|
9392
|
-
await
|
|
9397
|
+
await writeFile2(tempPath, htmlContent);
|
|
9393
9398
|
R2.step("GitHub App Configuration");
|
|
9394
9399
|
R2.message("Opening GitHub with your manifest...");
|
|
9395
9400
|
if (!globalConfig.noOpen) {
|
|
@@ -9481,7 +9486,7 @@ class Orchestrator {
|
|
|
9481
9486
|
R2.step("Google OAuth Setup");
|
|
9482
9487
|
const googleOauthCallback = await Ze({
|
|
9483
9488
|
message: "Enter the Google OAuth callback URL:",
|
|
9484
|
-
placeholder: "https://
|
|
9489
|
+
placeholder: "https://localhost:3000/oauth/callback/google",
|
|
9485
9490
|
defaultValue: `http://localhost:3000/oauth/callback/google`
|
|
9486
9491
|
});
|
|
9487
9492
|
if (Ct(googleOauthCallback)) {
|
|
@@ -9494,7 +9499,7 @@ class Orchestrator {
|
|
|
9494
9499
|
R2.step("GitHub OAuth Setup");
|
|
9495
9500
|
const githubOauthCallback = await Ze({
|
|
9496
9501
|
message: "Enter the GitHub OAuth callback URL:",
|
|
9497
|
-
placeholder: "
|
|
9502
|
+
placeholder: "http://localhost:3000/oauth/callback/github",
|
|
9498
9503
|
defaultValue: `http://localhost:3000/oauth/callback/github`
|
|
9499
9504
|
});
|
|
9500
9505
|
if (Ct(githubOauthCallback)) {
|