@@ -5,7 +5,6 @@ import { displaySuccess } from "../../components/GlobalSnackbar/utils"
5
5
6
6
export const Language = {
7
7
successProfileUpdate : "Updated settings." ,
8
- successRegenerateSSHKey : "SSH Key regenerated successfully" ,
9
8
}
10
9
11
10
export const checks = {
@@ -83,20 +82,12 @@ export interface AuthContext {
83
82
methods ?: TypesGen . AuthMethods
84
83
permissions ?: Permissions
85
84
checkPermissionsError ?: Error | unknown
86
- // SSH
87
- sshKey ?: TypesGen . GitSSHKey
88
- getSSHKeyError ?: Error | unknown
89
- regenerateSSHKeyError ?: Error | unknown
90
85
}
91
86
92
87
export type AuthEvent =
93
88
| { type : "SIGN_OUT" }
94
89
| { type : "SIGN_IN" ; email : string ; password : string }
95
90
| { type : "UPDATE_PROFILE" ; data : TypesGen . UpdateUserProfileRequest }
96
- | { type : "GET_SSH_KEY" }
97
- | { type : "REGENERATE_SSH_KEY" }
98
- | { type : "CONFIRM_REGENERATE_SSH_KEY" }
99
- | { type : "CANCEL_REGENERATE_SSH_KEY" }
100
91
| { type : "GET_AUTH_METHODS" }
101
92
102
93
export const authMachine =
@@ -128,12 +119,6 @@ export const authMachine =
128
119
checkPermissions : {
129
120
data : TypesGen . AuthorizationResponse
130
121
}
131
- getSSHKey : {
132
- data : TypesGen . GitSSHKey
133
- }
134
- regenerateSSHKey : {
135
- data : TypesGen . GitSSHKey
136
- }
137
122
hasFirstUser : {
138
123
data : boolean
139
124
}
@@ -279,79 +264,6 @@ export const authMachine =
279
264
} ,
280
265
} ,
281
266
} ,
282
- ssh : {
283
- initial : "idle" ,
284
- states : {
285
- idle : {
286
- on : {
287
- GET_SSH_KEY : {
288
- target : "gettingSSHKey" ,
289
- } ,
290
- } ,
291
- } ,
292
- gettingSSHKey : {
293
- entry : "clearGetSSHKeyError" ,
294
- invoke : {
295
- src : "getSSHKey" ,
296
- onDone : [
297
- {
298
- actions : "assignSSHKey" ,
299
- target : "loaded" ,
300
- } ,
301
- ] ,
302
- onError : [
303
- {
304
- actions : "assignGetSSHKeyError" ,
305
- target : "idle" ,
306
- } ,
307
- ] ,
308
- } ,
309
- } ,
310
- loaded : {
311
- initial : "idle" ,
312
- states : {
313
- idle : {
314
- on : {
315
- REGENERATE_SSH_KEY : {
316
- target : "confirmSSHKeyRegenerate" ,
317
- } ,
318
- } ,
319
- } ,
320
- confirmSSHKeyRegenerate : {
321
- on : {
322
- CANCEL_REGENERATE_SSH_KEY : {
323
- target : "idle" ,
324
- } ,
325
- CONFIRM_REGENERATE_SSH_KEY : {
326
- target : "regeneratingSSHKey" ,
327
- } ,
328
- } ,
329
- } ,
330
- regeneratingSSHKey : {
331
- entry : "clearRegenerateSSHKeyError" ,
332
- invoke : {
333
- src : "regenerateSSHKey" ,
334
- onDone : [
335
- {
336
- actions : [
337
- "assignSSHKey" ,
338
- "notifySuccessSSHKeyRegenerated" ,
339
- ] ,
340
- target : "idle" ,
341
- } ,
342
- ] ,
343
- onError : [
344
- {
345
- actions : "assignRegenerateSSHKeyError" ,
346
- target : "idle" ,
347
- } ,
348
- ] ,
349
- } ,
350
- } ,
351
- } ,
352
- } ,
353
- } ,
354
- } ,
355
267
methods : {
356
268
initial : "idle" ,
357
269
states : {
@@ -480,9 +392,6 @@ export const authMachine =
480
392
checks : permissionsToCheck ,
481
393
} )
482
394
} ,
483
- // SSH
484
- getSSHKey : ( ) => API . getUserSSHKey ( ) ,
485
- regenerateSSHKey : ( ) => API . regenerateUserSSHKey ( ) ,
486
395
// First user
487
396
hasFirstUser : ( ) => API . hasFirstUser ( ) ,
488
397
} ,
@@ -538,25 +447,6 @@ export const authMachine =
538
447
clearGetPermissionsError : assign ( {
539
448
checkPermissionsError : ( _ ) => undefined ,
540
449
} ) ,
541
- // SSH
542
- assignSSHKey : assign ( {
543
- sshKey : ( _ , event ) => event . data ,
544
- } ) ,
545
- assignGetSSHKeyError : assign ( {
546
- getSSHKeyError : ( _ , event ) => event . data ,
547
- } ) ,
548
- clearGetSSHKeyError : assign ( {
549
- getSSHKeyError : ( _ ) => undefined ,
550
- } ) ,
551
- assignRegenerateSSHKeyError : assign ( {
552
- regenerateSSHKeyError : ( _ , event ) => event . data ,
553
- } ) ,
554
- clearRegenerateSSHKeyError : assign ( {
555
- regenerateSSHKeyError : ( _ ) => undefined ,
556
- } ) ,
557
- notifySuccessSSHKeyRegenerated : ( ) => {
558
- displaySuccess ( Language . successRegenerateSSHKey )
559
- } ,
560
450
redirect : ( _ , { data } ) => {
561
451
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- data can be undefined
562
452
if ( ! data ) {
0 commit comments