auth 1.2.1 → 1.2.2
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/commands/add.js +8 -10
- package/package.json +1 -1
package/commands/add.js
CHANGED
|
@@ -38,19 +38,17 @@ const choices = Object.entries(providers)
|
|
|
38
38
|
/** @param {string | undefined} providerId */
|
|
39
39
|
export async function action(providerId) {
|
|
40
40
|
try {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const provider = providers[pid]
|
|
41
|
+
providerId ??= await select({
|
|
42
|
+
message: "What provider do you want to set up?",
|
|
43
|
+
choices: choices,
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
const provider = providers[providerId]
|
|
49
47
|
if (!provider?.setupUrl) {
|
|
50
48
|
console.error(
|
|
51
49
|
y.red(
|
|
52
50
|
`Missing instructions for ${
|
|
53
|
-
provider?.name ??
|
|
51
|
+
provider?.name ?? providerId
|
|
54
52
|
}.\nInstructions are available for: ${y.bold(
|
|
55
53
|
choices.map((choice) => choice.name).join(", ")
|
|
56
54
|
)}`
|
|
@@ -135,7 +133,7 @@ ${y.bold("Callback URL (copied to clipboard)")}: ${url}`
|
|
|
135
133
|
|
|
136
134
|
console.log(y.dim("Updating environment variable file..."))
|
|
137
135
|
|
|
138
|
-
const varPrefix = `AUTH_${
|
|
136
|
+
const varPrefix = `AUTH_${providerId.toUpperCase()}`
|
|
139
137
|
await updateEnvFile({
|
|
140
138
|
[`${varPrefix}_ID`]: clientId,
|
|
141
139
|
[`${varPrefix}_SECRET`]: clientSecret,
|