Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2f6ee7f

Browse files
committed
Add comments to code timeout
1 parent c52693f commit 2f6ee7f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

enterprise/coderd/identityprovider/authorize.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ func Authorize(db database.Store, accessURL *url.URL) http.HandlerFunc {
111111
ID: uuid.New(),
112112
CreatedAt: dbtime.Now(),
113113
// TODO: Configurable expiration? Ten minutes matches GitHub.
114+
// This timeout is only for the code that will be exchanged for the
115+
// access token, not the access token itself. It does not need to be
116+
// long-lived because normally it will be exchanged immediately after it
117+
// is received. If the application does wait before exchanging the
118+
// token (for example suppose they ask the user to confirm and the user
119+
// has left) then they can just retry immediately and get a new code.
114120
ExpiresAt: dbtime.Now().Add(time.Duration(10) * time.Minute),
115121
HashedSecret: []byte(hashedCode),
116122
AppID: app.ID,

0 commit comments

Comments
 (0)