File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ const STORAGE_KEY = 'npmx-connector'
5757const DEFAULT_PORT = 31415
5858
5959export const useConnector = createSharedComposable ( function useConnector ( ) {
60+ const { settings } = useSettings ( )
61+
6062 // Persisted connection config
6163 const config = useState < { token : string ; port : number } | null > ( 'connector-config' , ( ) => null )
6264
@@ -303,7 +305,11 @@ export const useConnector = createSharedComposable(function useConnector() {
303305 ApiResponse < { results : unknown [ ] ; otpRequired ?: boolean } >
304306 > ( '/execute' , {
305307 method : 'POST' ,
306- body : otp ? { otp } : undefined ,
308+ body : {
309+ otp,
310+ interactive : settings . value . connector . webAuth ,
311+ openUrls : settings . value . connector . autoOpenURL ,
312+ } ,
307313 } )
308314 if ( response ?. success ) {
309315 await refreshState ( )
Original file line number Diff line number Diff line change @@ -29,6 +29,13 @@ export interface AppSettings {
2929 selectedLocale : LocaleObject [ 'code' ] | null
3030 /** Search provider for package search */
3131 searchProvider : SearchProvider
32+ /** Connector preferences */
33+ connector : {
34+ /** Use web-based authentication instead of CLI token */
35+ webAuth : boolean
36+ /** Automatically open the web auth page in the browser */
37+ autoOpenURL : boolean
38+ }
3239 sidebar : {
3340 collapsed : string [ ]
3441 }
@@ -42,6 +49,10 @@ const DEFAULT_SETTINGS: AppSettings = {
4249 selectedLocale : null ,
4350 preferredBackgroundTheme : null ,
4451 searchProvider : import . meta. test ? 'npm' : 'algolia' ,
52+ connector : {
53+ webAuth : false ,
54+ autoOpenURL : false ,
55+ } ,
4556 sidebar : {
4657 collapsed : [ ] ,
4758 } ,
You can’t perform that action at this time.
0 commit comments