Skip to content

Commit

Permalink
feat(auth): use 'X-Token' as authentication header
Browse files Browse the repository at this point in the history
  • Loading branch information
arrio464 committed Jan 30, 2025
1 parent d9956e6 commit 87e53f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/lang/en/drivers.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
"url": "Url"
},
"AList V3": {
"auth_header": "Authorization Header",
"meta_password": "Meta password",
"pass_ua_to_upsteam": "Pass ua to upsteam",
"password": "Password",
Expand Down
4 changes: 2 additions & 2 deletions src/utils/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ instance.interceptors.response.use(
},
)

instance.defaults.headers.common["Authorization"] =
instance.defaults.headers.common["X-Token"] =
localStorage.getItem("token") || ""

export const changeToken = (token?: string) => {
instance.defaults.headers.common["Authorization"] = token ?? ""
instance.defaults.headers.common["X-Token"] = token ?? ""
localStorage.setItem("token", token ?? "")
}

Expand Down

0 comments on commit 87e53f0

Please sign in to comment.