-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to use sessionType=refresh_token #4975
ref DEV-2326
- Loading branch information
Showing
47 changed files
with
947 additions
and
410 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,36 @@ | ||
package oauth | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/authgear/authgear-server/pkg/lib/session" | ||
) | ||
|
||
type GrantSessionKind string | ||
|
||
const ( | ||
GrantSessionKindOffline GrantSessionKind = "offline_grant" | ||
GrantSessionKindSession GrantSessionKind = "idp_session" | ||
) | ||
|
||
func (k GrantSessionKind) SessionType() session.Type { | ||
switch k { | ||
case GrantSessionKindSession: | ||
return session.TypeIdentityProvider | ||
case GrantSessionKindOffline: | ||
return session.TypeOfflineGrant | ||
default: | ||
panic(fmt.Errorf("unknown session kind: %v\n", k)) | ||
} | ||
} | ||
|
||
func GrantSessionKindFromSessionType(typ session.Type) GrantSessionKind { | ||
switch typ { | ||
case session.TypeIdentityProvider: | ||
return GrantSessionKindSession | ||
case session.TypeOfflineGrant: | ||
return GrantSessionKindOffline | ||
default: | ||
panic(fmt.Errorf("unknown session type: %v", typ)) | ||
} | ||
} |
Oops, something went wrong.