Skip to content

Commit

Permalink
Merge pull request #431 from supertokens/fix/changelog-with-migration…
Browse files Browse the repository at this point in the history
…-guide

fix: Update changelog with migration guide for form field value consumption
  • Loading branch information
rishabhpoddar authored Sep 27, 2024
2 parents 08844a5 + 9803fb8 commit 60e0dc2
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Changes the type of `value` in `TypeFormField` to `interface{}` instead of `string` to add support for any type of value in form fields.

### Migration

#### Typecast value of form fields to expected type before using it

To read a value from formFields where id is `name`,

Before:

```go
// formField should be of type []epmodels.TypeFormField
var name string
for id, value := range formFields {
if id == "name" {
name = value
}
}
```

After:

```go
// formField should be of type []epmodels.TypeFormField
var name string
for id, value := ranger formFields {
if id == "name" {
nameAsStr, asStrOk := value.(string)
if !asStrOk {
// Handle the error accordingly
}
name = nameAsStr
}
}
```

## [0.24.2] - 2024-09-03

- Fixes memory leak with the JWKS cache.
Expand Down

0 comments on commit 60e0dc2

Please sign in to comment.