File tree 4 files changed +24
-25
lines changed 4 files changed +24
-25
lines changed Original file line number Diff line number Diff line change @@ -372,9 +372,7 @@ type GithubOAuth2Config struct {
372
372
// @Success 200 {object} codersdk.AuthMethods
373
373
// @Router /users/authmethods [get]
374
374
func (api * API ) userAuthMethods (rw http.ResponseWriter , r * http.Request ) {
375
- var (
376
- key , ok = httpmw .APIKeyOptional (r )
377
- )
375
+ key , ok := httpmw .APIKeyOptional (r )
378
376
var currentUserLoginType codersdk.LoginType
379
377
if ok {
380
378
user , err := api .Database .GetUserByID (r .Context (), key .UserID )
Original file line number Diff line number Diff line change @@ -112,9 +112,9 @@ type LoginWithPasswordResponse struct {
112
112
113
113
type OauthConversionResponse struct {
114
114
StateString string `json:"state_string"`
115
- ExpiresAt time.Time `json:"expires_at"`
115
+ ExpiresAt time.Time `json:"expires_at" format:"date-time" `
116
116
ToLoginType LoginType `json:"to_login_type"`
117
- UserID uuid.UUID `json:"user_id"`
117
+ UserID uuid.UUID `json:"user_id" format:"uuid" `
118
118
}
119
119
120
120
type CreateOrganizationRequest struct {
Original file line number Diff line number Diff line change @@ -120,11 +120,13 @@ export const convertToOauth = async (
120
120
} )
121
121
122
122
try {
123
- const response = await axios . post < TypesGen . OauthConversionResponse > ( "/api/v2/users/convert-login" ,
124
- payload ,
125
- {
126
- headers : { ...CONTENT_TYPE_JSON } ,
127
- } )
123
+ const response = await axios . post < TypesGen . OauthConversionResponse > (
124
+ "/api/v2/users/convert-login" ,
125
+ payload ,
126
+ {
127
+ headers : { ...CONTENT_TYPE_JSON } ,
128
+ } ,
129
+ )
128
130
return response . data
129
131
} catch ( error ) {
130
132
if ( axios . isAxiosError ( error ) && error . response ?. status === 401 ) {
Original file line number Diff line number Diff line change @@ -1517,32 +1517,31 @@ export const MockAuditOauthConvert: TypesGen.AuditLog = {
1517
1517
created_at : {
1518
1518
old : "0001-01-01T00:00:00Z" ,
1519
1519
new : "2023-06-20T20:44:54.243019Z" ,
1520
- secret : false
1520
+ secret : false ,
1521
1521
} ,
1522
1522
expires_at : {
1523
- old : "0001-01-01T00:00:00Z" ,
1524
- new : "2023-06-20T20:49:54.243019Z" ,
1525
- secret : false
1523
+ old : "0001-01-01T00:00:00Z" ,
1524
+ new : "2023-06-20T20:49:54.243019Z" ,
1525
+ secret : false ,
1526
1526
} ,
1527
1527
state_string : {
1528
- old : "" ,
1529
- new : "" ,
1530
- secret : true
1528
+ old : "" ,
1529
+ new : "" ,
1530
+ secret : true ,
1531
1531
} ,
1532
1532
to_login_type : {
1533
- old : "" ,
1534
- new : "oidc" ,
1535
- secret : false
1533
+ old : "" ,
1534
+ new : "oidc" ,
1535
+ secret : false ,
1536
1536
} ,
1537
1537
user_id : {
1538
- old : "" ,
1539
- new : "dc790496-eaec-4f88-a53f-8ce1f61a1fff" ,
1540
- secret : false
1541
- }
1538
+ old : "" ,
1539
+ new : "dc790496-eaec-4f88-a53f-8ce1f61a1fff" ,
1540
+ secret : false ,
1541
+ } ,
1542
1542
} ,
1543
1543
}
1544
1544
1545
-
1546
1545
export const MockAuditLogSuccessfulLogin : TypesGen . AuditLog = {
1547
1546
...MockAuditLog ,
1548
1547
resource_type : "api_key" ,
You can’t perform that action at this time.
0 commit comments