Spaces:
Build error
Build error
saas: use alternative endpoint for auth
Browse files
src/dto/jina-embeddings-auth.ts
CHANGED
|
@@ -146,7 +146,10 @@ export class JinaEmbeddingsAuthDTO extends AutoCastable {
|
|
| 146 |
}
|
| 147 |
|
| 148 |
try {
|
| 149 |
-
|
|
|
|
|
|
|
|
|
|
| 150 |
const brief = r.data;
|
| 151 |
const draftAccount = JinaEmbeddingsTokenAccount.from({
|
| 152 |
...account, ...brief, _id: this.bearerToken,
|
|
|
|
| 146 |
}
|
| 147 |
|
| 148 |
try {
|
| 149 |
+
// TODO: go back using validateToken after performance issue fixed
|
| 150 |
+
const r = ((account?.wallet?.total_balance || 0) > 0) ?
|
| 151 |
+
await this.jinaEmbeddingsDashboard.authorization(this.bearerToken) :
|
| 152 |
+
await this.jinaEmbeddingsDashboard.validateToken(this.bearerToken);
|
| 153 |
const brief = r.data;
|
| 154 |
const draftAccount = JinaEmbeddingsTokenAccount.from({
|
| 155 |
...account, ...brief, _id: this.bearerToken,
|