mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 06:34:40 +03:00
webmail: rename query string param "token" to "singleUseToken" to be less scary in access logs
these singleusetokens can be redeemed once. so when you see it in the logs, it can't be used again. they are short-lived anyway. this change should help prevent me periodically investigating token handling...
This commit is contained in:
@ -130,9 +130,10 @@ func (w Webmail) Logout(ctx context.Context) {
|
||||
xcheckf(ctx, err, "logout")
|
||||
}
|
||||
|
||||
// Token returns a token to use for an SSE connection. A token can only be used for
|
||||
// a single SSE connection. Tokens are stored in memory for a maximum of 1 minute,
|
||||
// with at most 10 unused tokens (the most recently created) per account.
|
||||
// Token returns a single-use token to use for an SSE connection. A token can only
|
||||
// be used for a single SSE connection. Tokens are stored in memory for a maximum
|
||||
// of 1 minute, with at most 10 unused tokens (the most recently created) per
|
||||
// account.
|
||||
func (Webmail) Token(ctx context.Context) string {
|
||||
reqInfo := ctx.Value(requestInfoCtxKey).(requestInfo)
|
||||
return sseTokens.xgenerate(ctx, reqInfo.Account.Name, reqInfo.LoginAddress, reqInfo.SessionToken)
|
||||
|
Reference in New Issue
Block a user