move expiry to const
This commit is contained in:
1 parent
1e98e98c04
commit
630668cff4
1 file changed
+4
-2
@@ -24,6 +24,8 @@ namespace Invidious
|
|||||||
const AUTH_TOKENS_UNREGISTER = "/api/v1/auth/tokens/unregister"
|
const AUTH_TOKENS_UNREGISTER = "/api/v1/auth/tokens/unregister"
|
||||||
const AUTH_TOKENS_REGISTER = "/api/v1/auth/tokens/register"
|
const AUTH_TOKENS_REGISTER = "/api/v1/auth/tokens/register"
|
||||||
|
|
||||||
|
const TOKEN_TIMESPAN = 60 * 60 * 24 * 365 * 2 '2 years
|
||||||
|
|
||||||
function DefaultArgs() as object
|
function DefaultArgs() as object
|
||||||
return {
|
return {
|
||||||
params: {
|
params: {
|
||||||
@@ -153,7 +155,7 @@ namespace Invidious
|
|||||||
|
|
||||||
localIp = GetLocalIpAddress()
|
localIp = GetLocalIpAddress()
|
||||||
webServerPort = 8888
|
webServerPort = 8888
|
||||||
expire = TimeUtils.Now().AsSeconds() + 60 * 60 * 24 * 365 * 2 '2 years from now
|
expire = TimeUtils.Now().AsSeconds() + TOKEN_TIMESPAN
|
||||||
|
|
||||||
callbackUrl = `http://${localIp}:${webServerPort}${Invidious.TOKEN_CALLBACK}?ref=${instance}`.EncodeUriComponent()
|
callbackUrl = `http://${localIp}:${webServerPort}${Invidious.TOKEN_CALLBACK}?ref=${instance}`.EncodeUriComponent()
|
||||||
scope = `${Invidious.AUTH_SCOPES}`.EncodeUriComponent()
|
scope = `${Invidious.AUTH_SCOPES}`.EncodeUriComponent()
|
||||||
@@ -172,7 +174,7 @@ namespace Invidious
|
|||||||
return false
|
return false
|
||||||
end if
|
end if
|
||||||
|
|
||||||
expire = TimeUtils.Now().AsSeconds() + 60 * 60 * 24 * 365 * 2 '2 years from now
|
expire = TimeUtils.Now().AsSeconds() + TOKEN_TIMESPAN
|
||||||
|
|
||||||
newToken = RegisterToken(currentAuthToken, expire)
|
newToken = RegisterToken(currentAuthToken, expire)
|
||||||
if newToken = invalid
|
if newToken = invalid
|
||||||
|
|||||||
Reference in new issue
Block a user