Better login (#39)
* Better login * Lint fix * Restore some changes Co-authored-by: github-action linter <githubaction@githubaction.com>
This commit is contained in:
1 parent
fa1bc29220
commit
90df81df4b
2 files changed
+3
-3
No files matched your search
@@ -32,10 +32,10 @@ namespace Http
|
||||
response = context.response
|
||||
server = context.server
|
||||
|
||||
if request.query["token"] <> invalid and request.query["referer"] <> invalid
|
||||
if request.query["token"] <> invalid and request.query["ref"] <> invalid
|
||||
' Token is encoded twice for some reason
|
||||
token = request.query["token"].DecodeUri().DecodeUriComponent()
|
||||
referer = request.query["referer"].DecodeUri()
|
||||
referer = request.query["ref"].DecodeUri()
|
||||
InvidiousSettings.SetAuthToken(token, referer)
|
||||
server.task.top.login = true
|
||||
end if
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace Invidious
|
||||
webServerPort = 8888
|
||||
expire = TimeUtils.Now().AsSeconds() + 60 * 60 * 24 * 365 * 2 '2 years from now
|
||||
|
||||
callbackUrl = `http://${localIp}:${webServerPort}${Invidious.TOKEN_CALLBACK}?referer=${instance}`.EncodeUriComponent()
|
||||
callbackUrl = `http://${localIp}:${webServerPort}${Invidious.TOKEN_CALLBACK}?ref=${instance}`.EncodeUriComponent()
|
||||
return `${invidiousHost}/authorize_token?scopes=${Invidious.AUTH_SCOPE}&callback_url=${callbackUrl}&expire=${expire}`
|
||||
end function
|
||||
|
||||
|
||||
Reference in new issue
Block a user