Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipd: Fix checking for totp type #148

Merged
merged 2 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,11 @@ chrome.runtime.onMessage.addListener((request, _sender, sendResponse) => {
// Asynchronous response
Promise.all([
credentials.userDataExists(request.platform),
credentials.userDataExists(request.platform + "-totp"),
credentials.userDataExists(request.platform + "-iotp")
credentials.userDataExists(request.platform + '-totp'),
credentials.userDataExists(request.platform + '-iotp')
]).then(([loginExists, totpExists, iotpExists]) => {
sendResponse(loginExists || totpExists || iotpExists)
});
})
return true // required for async sendResponse
case 'delete_user_data':
// Asynchronous response
Expand Down
4 changes: 3 additions & 1 deletion src/contentScripts/login/idp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ const cookieSettings: CookieSettings = {

const otpInput = document.getElementById('fudis_otp_input') as HTMLInputElement | null
if (otpInput) {
const indexesText = otpInput.parentElement?.parentElement?.querySelector('td:first-of-type')?.textContent?.trim()
const indexesText = otpInput.parentElement?.parentElement?.parentElement
?.querySelector('div:first-of-type')
?.textContent?.trim()
// find number & number | remove whole match | to numbers | to zero based (first index is 0)
const indexes = indexesText?.match(/(\d+) & (\d+)/)?.slice(1, 3).map((x) => Number.parseInt(x, 10) - 1)

Expand Down
5 changes: 4 additions & 1 deletion src/freshContent/settings/settingPages/AutoLogin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
Zwei-Faktor-Authentisierung (2FA): Das Automatische Anmelden unterstützt auch 2FA. Hier kannst du dafür deinen TOTP Secret-Key speichern.
Der Key ist Base32 enkodiert und sieht bspw. so aus: <br>
MHSTKUIKTTHPQAZNVWQBJE5YQ2WACQQP <br>
Hier findest du <a style="color:white" href="https://github.com/TUfast-TUD/TUfast_TUD/blob/main/docs/2FA.md">mehr Informationen und eine vollständige Anleitung zur Einrichtung</a>.
Hier findest du <a
style="color:white"
href="https://github.com/TUfast-TUD/TUfast_TUD/blob/main/docs/2FA.md"
>mehr Informationen und eine vollständige Anleitung zur Einrichtung</a>.
</p>
<div class="form">
<CustomInput
Expand Down
Loading