修改siliconflow登录的clientId#61
Merged
Merged
Conversation
* fix * auto prettier format code * fix * fix --------- Co-authored-by: linjm8780860 <11494038+linjm8780860@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR updates the Siliconflow OAuth integration by changing the clientId and adjusting the index used when extracting the secretKey from the popup message.
- Update hard-coded
clientIdfor Siliconflow login - Change array index check for
secretKeyin the OAuth popup message
Comments suppressed due to low confidence (2)
src/views/btnApiKey/apiKeyDialog.vue:100
- [nitpick] Accessing
event.databy magic indices is fragile. Consider destructuring the payload or validating its shape before use, for clearer intent and safer indexing.
setKey(event.data[0]['secretKey'])
src/views/btnApiKey/apiKeyDialog.vue:93
- The new login flow logic isn’t covered by existing tests. Consider adding unit or integration tests for
openOAuthPopupto verify correct URL generation, popup handling, and message parsing.
const openOAuthPopup = async (setKey: (key: string) => void) => {
|
|
||
| const openOAuthPopup = async (setKey: (key: string) => void) => { | ||
| const clientId = 'SFIW4myD4HvRT9u9HF12hk' | ||
| const clientId = 'SFtNABXGEb5rZxogl8p3cM' |
There was a problem hiding this comment.
Avoid hard-coding the OAuth clientId directly in the component. Consider moving this value to a configuration file or environment variable to make future updates and environment overrides easier.
doombeaker
approved these changes
May 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.