Logo
Explore Help
Register Sign In
oadmin/new-api
1
0
Fork 0
You've already forked new-api
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
5a22f33bcfcc9085f45bcfb6e1dcfb8828b26a06
new-api/web/src/helpers/auth.js

10 lines
249 B
JavaScript
Raw Normal View History

Initial commit
2023-04-22 20:39:27 +08:00
export function authHeader() {
chore: lint fix
2024-03-23 21:24:39 +08:00
// return authorization header with jwt token
let user = JSON.parse(localStorage.getItem('user'));
Initial commit
2023-04-22 20:39:27 +08:00
chore: lint fix
2024-03-23 21:24:39 +08:00
if (user && user.token) {
return { Authorization: 'Bearer ' + user.token };
} else {
return {};
}
♻️ refactor(helpers): standardize file naming conventions and improve code organization - Rename files to follow camelCase naming convention: • auth-header.js → authUtils.js • other.js → logUtils.js • rehypeSplitWordsIntoSpans.js → textAnimationUtils.js - Update import paths in affected components: • Update exports in helpers/index.js • Fix import in LogsTable.js for logUtils • Fix import in MarkdownRenderer.js for textAnimationUtils - Remove old files after successful migration - Improve file naming clarity: • authUtils.js better describes authentication utilities • logUtils.js clearly indicates log processing functions • textAnimationUtils.js concisely describes text animation functionality This refactoring enhances code maintainability and follows consistent naming patterns throughout the helpers directory.
2025-06-03 16:13:50 +08:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 25.5.0 Page: 705ms Template: 27ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API