File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -96,10 +96,13 @@ func buildExternalId(user *object.User) optional.String {
96
96
func buildMeta (user * object.User ) scim.Meta {
97
97
createdTime := util .String2Time (user .CreatedTime )
98
98
updatedTime := util .String2Time (user .UpdatedTime )
99
+ if user .UpdatedTime == "" {
100
+ updatedTime = createdTime
101
+ }
99
102
return scim.Meta {
100
103
Created : & createdTime ,
101
104
LastModified : & updatedTime ,
102
- Version : user . Id ,
105
+ Version : util . Time2String ( updatedTime ) ,
103
106
}
104
107
}
105
108
Original file line number Diff line number Diff line change @@ -54,6 +54,10 @@ func String2Time(timestamp string) time.Time {
54
54
return parseTime
55
55
}
56
56
57
+ func Time2String (timestamp time.Time ) string {
58
+ return timestamp .Format (time .RFC3339 )
59
+ }
60
+
57
61
func IsTokenExpired (createdTime string , expiresIn int ) bool {
58
62
createdTimeObj , _ := time .Parse (time .RFC3339 , createdTime )
59
63
expiresAtObj := createdTimeObj .Add (time .Duration (expiresIn ) * time .Second )
You can’t perform that action at this time.
0 commit comments