mirror of
				https://github.com/steveiliop56/tinyauth.git
				synced 2025-10-31 14:15:50 +00:00 
			
		
		
		
	fix: handle type string for oauth groups
This commit is contained in:
		| @@ -327,3 +327,15 @@ func DeriveKey(secret string, info string) (string, error) { | ||||
| 	encodedKey := base64.StdEncoding.EncodeToString(key) | ||||
| 	return encodedKey, nil | ||||
| } | ||||
|  | ||||
| func CoalesceToString(value any) string { | ||||
| 	switch v := value.(type) { | ||||
| 	case []string: | ||||
| 		return strings.Join(v, ",") | ||||
| 	case string: | ||||
| 		return v | ||||
| 	default: | ||||
| 		log.Warn().Interface("value", value).Msg("Unsupported type, returning empty string") | ||||
| 		return "" | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Stavros
					Stavros