diff --git a/.github/workflows/login.yml b/.github/workflows/login.yml index 59a775a..5087cbc 100644 --- a/.github/workflows/login.yml +++ b/.github/workflows/login.yml @@ -20,8 +20,7 @@ jobs: - name: Check In run: node index.js env: - SK_OAUTH_CRED_KEY: ${{ secrets.SK_OAUTH_CRED_KEY }} - SK_TOKEN_CACHE_KEY: ${{ secrets.SK_TOKEN_CACHE_KEY }} + ACCOUNT_TOKEN: ${{ secrets.ACCOUNT_TOKEN }} DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} DISCORD_USER: ${{ secrets.DISCORD_USER }} workflow-keepalive: diff --git a/README.md b/README.md index 965d639..b8ae377 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,13 @@ Today's check in status: Repository version: [![Do your setup!](../../actions/workflows/version.yml/badge.svg)](../../actions/workflows/version.yml) +> [!NOTE] +> The script might stop working after a few months, there is currently no way of knowing when it will definitely break. +> If the status failed several times, try to redo your setup again before reporting it as an issue. + ## Table of Contents -- [Getting your auth token](#getting-your-auth-token) +- [Getting your account token](#getting-your-account-token) - [Usage](#usage) - [Discord Webhook](#discord-webhook) - [FAQ](#faq) @@ -16,9 +20,9 @@ Repository version: - [How to update my (fork) repository version?](#how-to-update-my-fork-repository-version) - [I have other issues](#i-have-other-issues) -## Getting your auth token +## Getting your account token -You have to check in manually first to get your auth token, follow these steps (click to open screenshot): +You have to check in manually first to get your account token, follow these steps (click to open screenshot): 1. Open [SKPORT Arknights: Endfield Daily Sign In](https://game.skport.com/endfield/sign-in) and login if you haven't (obviously) @@ -28,25 +32,15 @@ You have to check in manually first to get your auth token, follow these steps ( 4.
- For Chromium users, click on the Application tab. If not found, click on the arrow. - image + For Chromium users, click on the Application tab -> Cookies, click on ACCOUNT_TOKEN, and check Show URL-encoded. + image
- For Firefox/Gecko-based browsers, click on the Storage tab. - image + For Firefox/Gecko-based browsers, click on the Storage tab -> Cookies, and copy ACCOUNT_TOKEN value. + image
-5.
- Just like the screenshot above, click on Local Storage and look for SK_OAUTH_CRED_KEY and SK_TOKEN_CACHE_KEY. Copy both! - image -
- -6.
- Copy the value by clicking on it, then selecting the text below. Or just double-click and Ctrl+C - image -
- -7. That's your auth credentials and token, keep it save and do NOT share it with anyone! +5. That's your account token, keep it save and do NOT share it with anyone! ## Usage @@ -59,20 +53,18 @@ You have to check in manually first to get your auth token, follow these steps ( 5.
- Insert both SK_OAUTH_CRED_KEY and SK_TOKEN_CACHE_KEY then click Add secret. You can input as many accounts, separate it with a new line (Enter). + Insert the name ACCOUNT_TOKEN and the secret of your account token from before, then click Add secret. You can input as many accounts, separate it with a new line (Enter). - image - image -
+ image + 6.
- Here is the example for multiple accounts and your environments should now look like this. + Here is the example secret value for multiple accounts. - image - image + image
- + 7.
For the first day, you have to trigger this manually. diff --git a/index.js b/index.js index 6fc4ae5..d5aea37 100755 --- a/index.js +++ b/index.js @@ -7,7 +7,7 @@ import crypto from 'crypto' -const accountTokens = (process.env.ACCOUNT_TOKEN || "").split('\n').map(s => s.trim()).filter(Boolean) +const accountTokens = (process.env.ACCOUNT_TOKEN || "").split('\n').map(s => decodeURIComponent(s.trim())).filter(Boolean) const discordWebhook = process.env.DISCORD_WEBHOOK const discordUser = process.env.DISCORD_USER