feat: support time_zone for user registration context
This commit is contained in:
@@ -91,6 +91,20 @@ func ParseClientPublicKey(value string) (common.ClientPublicKey, error) {
|
||||
return key, nil
|
||||
}
|
||||
|
||||
// ParseTimeZone trims value and validates it as an IANA time zone name.
|
||||
func ParseTimeZone(value string) (string, error) {
|
||||
timeZone := NormalizeString(value)
|
||||
if timeZone == "" {
|
||||
return "", InvalidRequest("time_zone must not be empty")
|
||||
}
|
||||
|
||||
if _, err := time.LoadLocation(timeZone); err != nil {
|
||||
return "", InvalidRequest("time_zone must be a valid IANA time zone name")
|
||||
}
|
||||
|
||||
return timeZone, nil
|
||||
}
|
||||
|
||||
// ParseRevokeReasonCode trims value and validates it as one machine-readable
|
||||
// revoke reason code.
|
||||
func ParseRevokeReasonCode(value string) (common.RevokeReasonCode, error) {
|
||||
|
||||
Reference in New Issue
Block a user