@vellumai/credential-executor 0.6.1 → 0.6.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.
|
@@ -146,14 +146,12 @@ export function parseHandle(raw: string): ParseHandleResult {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
case HandleType.LocalOAuth: {
|
|
149
|
-
// providerKey
|
|
150
|
-
|
|
151
|
-
// *last* "/" to separate providerKey from connectionId.
|
|
152
|
-
const lastSlashIdx = rest.lastIndexOf("/");
|
|
149
|
+
// Split providerKey from connectionId.
|
|
150
|
+
const slashIdx = rest.indexOf("/");
|
|
153
151
|
if (
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
152
|
+
slashIdx === -1 ||
|
|
153
|
+
slashIdx === 0 ||
|
|
154
|
+
slashIdx === rest.length - 1
|
|
157
155
|
) {
|
|
158
156
|
return {
|
|
159
157
|
ok: false,
|
|
@@ -164,8 +162,8 @@ export function parseHandle(raw: string): ParseHandleResult {
|
|
|
164
162
|
ok: true,
|
|
165
163
|
handle: {
|
|
166
164
|
type: HandleType.LocalOAuth,
|
|
167
|
-
providerKey: rest.slice(0,
|
|
168
|
-
connectionId: rest.slice(
|
|
165
|
+
providerKey: rest.slice(0, slashIdx),
|
|
166
|
+
connectionId: rest.slice(slashIdx + 1),
|
|
169
167
|
raw,
|
|
170
168
|
},
|
|
171
169
|
};
|