WebClient: refactor long-running tasks to improve browser compatibility

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2024-03-11 18:19:57 +01:00
parent baaef63d1d
commit f38966c6ac
12 changed files with 1118 additions and 243 deletions

View File

@@ -29,6 +29,7 @@ const (
SessionTypeResetCode
SessionTypeOAuth2Auth
SessionTypeInvalidToken
SessionTypeWebTask
)
// Session defines a shared session persisted in the data provider
@@ -43,7 +44,7 @@ func (s *Session) validate() error {
if s.Key == "" {
return errors.New("unable to save a session with an empty key")
}
if s.Type < SessionTypeOIDCAuth || s.Type > SessionTypeInvalidToken {
if s.Type < SessionTypeOIDCAuth || s.Type > SessionTypeWebTask {
return fmt.Errorf("invalid session type: %v", s.Type)
}
return nil