mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 04:18:01 +00:00
e17b49e4ca
* feat: manage apple idp * handle apple idp callback * add tests for provider * basic console implementation * implement flow for login UI and add logos / styling * tests * cleanup * add upload button * begin i18n * apple logo positioning, file upload component * fix add apple instance idp * add missing apple logos for login * update to go 1.21 * fix slice compare * revert permission changes * concrete error messages * translate login apple logo -y-2px * change form parsing * sign in button * fix tests * lint console --------- Co-authored-by: peintnermax <max@caos.ch>
29 lines
485 B
Go
29 lines
485 B
Go
package form
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gorilla/schema"
|
|
|
|
"github.com/zitadel/zitadel/internal/errors"
|
|
)
|
|
|
|
type Parser struct {
|
|
decoder *schema.Decoder
|
|
}
|
|
|
|
func NewParser() *Parser {
|
|
d := schema.NewDecoder()
|
|
d.IgnoreUnknownKeys(true)
|
|
return &Parser{d}
|
|
}
|
|
|
|
func (p *Parser) Parse(r *http.Request, data interface{}) error {
|
|
err := r.ParseForm()
|
|
if err != nil {
|
|
return errors.ThrowInternal(err, "FORM-lCC9zI", "Errors.Internal")
|
|
}
|
|
|
|
return p.decoder.Decode(data, r.Form)
|
|
}
|