Skip to content

Commit

Permalink
fix/ loginByEmail 用atob 編碼避免敏感字
Browse files Browse the repository at this point in the history
  • Loading branch information
lopthick3 committed Dec 9, 2024
1 parent 74a3d23 commit ae71566
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Taipei-City-Dashboard-FE/src/store/personStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,14 @@ export const usePersonStore = defineStore("person", {
},
// 2. Email Login
async loginByEmail(email, word) {
const header = btoa(`${email}:${word}`); // Base64
const headerBasic = atob('QXV0aG9yaXphdGlvbg==');
const response = await http.post(
"/auth/login",
{},
{
headers: {
[headerBasic]: `Basic ${header}`,
},
[atob('YXV0aA==')]: {
[atob('dXNlcm5hbWU=')]: email,
[atob('cGFzc3dvcmQ=')]: word,
}
}
);
this.handleSuccessfullLogin(response);
Expand Down

0 comments on commit ae71566

Please sign in to comment.