forked from cypht-org/cypht
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cypht-org#819 from Yannick243/2FA-configuration-co…
…nfirm Make sure the user has configured Google Authenticator before enabling 2FA authentication
- Loading branch information
Showing
4 changed files
with
479 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,219 @@ | ||
.tfa_error, .tfa_input { margin-left: 20px; } | ||
.tfa_error { color: red; margin-right: 20px; margin-bottom: 10px; } | ||
.tfa_setting { display: none; } | ||
.mobile .tfa_input { max-width: 340px; margin-bottom: 10px; } | ||
:root { | ||
--tfa-form-valid-color: #198754; | ||
--tfa-form-valid-border-color: #198754; | ||
--tfa-form-invalid-color: #dc3545; | ||
--tfa-form-invalid-border-color: #dc3545; | ||
--tfa-border-radius: 0.375rem; | ||
--tfa-border-color: #dee2e6; | ||
--tfa-base-color: #666; | ||
--tfa-secondary-color: rgba(33, 37, 41, 0.75); | ||
} | ||
|
||
.tfa_error, | ||
.tfa_input { | ||
margin-left: 20px; | ||
} | ||
|
||
.tfa_error { | ||
color: red; | ||
margin-right: 20px; | ||
margin-bottom: 10px; | ||
} | ||
|
||
.tfa_setting { | ||
display: none; | ||
} | ||
|
||
.user_settings .tfa_setting td { | ||
height: auto; | ||
} | ||
|
||
.mobile .tfa_input { | ||
max-width: 340px; | ||
margin-bottom: 10px; | ||
} | ||
|
||
.tfa_mt_1 { | ||
margin-top: 0.7rem; | ||
} | ||
|
||
.tfa_mb_1 { | ||
margin-bottom: 0.7rem; | ||
} | ||
|
||
.tfa_confirmation_fieldset { | ||
color: var(--tfa-base-color); | ||
border-radius: var(--tfa-border-radius); | ||
border: 1px solid var(--tfa-border-color); | ||
max-width: 365px; | ||
} | ||
|
||
.tfa_confirmation_wrapper .tfa_confirmation_hint { | ||
font-style: italic; | ||
font-size: 0.75em; | ||
margin-top: 0.8rem; | ||
color: var(--tfa-secondary-color); | ||
} | ||
.tfa_confirmation_wrapper .tfa_confirmation_hint .invalid { | ||
color: var(--tfa-form-invalid-color); | ||
} | ||
.tfa_confirmation_wrapper .valid { | ||
border-color: var(--tfa-form-valid-color); | ||
padding-right: calc(1.5em + 0.75rem); | ||
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e"); | ||
background-repeat: no-repeat; | ||
background-position: right calc(0.375em + 0.1875rem) center; | ||
background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem); | ||
} | ||
.tfa_confirmation_wrapper .invalid { | ||
border-color: var(--tfa-form-invalid-color); | ||
} | ||
.tfa_confirmation_wrapper input::-webkit-outer-spin-button, | ||
.tfa_confirmation_wrapper input::-webkit-inner-spin-button { | ||
-webkit-appearance: none; | ||
margin: 0; | ||
} | ||
.tfa_confirmation_wrapper input[type=number] { | ||
-moz-appearance: textfield; | ||
} | ||
.tfa_confirmation_wrapper input, | ||
.tfa_confirmation_wrapper button, | ||
.tfa_confirmation_wrapper a { | ||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); | ||
} | ||
|
||
.tfa_confirmation_input_digits { | ||
--total-digits: 6; | ||
display: grid; | ||
grid-template-columns: repeat(var(--total-digits), 1fr); | ||
gap: 0.5rem; | ||
} | ||
.tfa_confirmation_input_digit { | ||
display: block; | ||
width: 2rem; | ||
height: 2rem; | ||
padding: 0.625rem; | ||
border: 1px solid var(--tfa-border-color); | ||
border-radius: var(--tfa-border-radius); | ||
font-size: 1.5rem; | ||
text-align: center; | ||
} | ||
.tfa_confirmation_input_digit:focus { | ||
color: #212529; | ||
background-color: #fff; | ||
border-color: #86b7fe; | ||
outline: 0; | ||
box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25); | ||
} | ||
.tfa_confirmation_input_button { | ||
padding: 10px; | ||
color: var(--tfa-base-color); | ||
border-radius: var(--tfa-border-radius); | ||
border: 1px solid var(--tfa-border-color); | ||
background-color: #fff; | ||
text-decoration: none; | ||
margin-top: 0.8rem; | ||
font-size: 0.9rem; | ||
} | ||
.tfa_confirmation_input_button:hover { | ||
cursor: pointer; | ||
} | ||
.tfa_confirmation_input_button.invalid { | ||
padding-right: calc(1.5em + 0.75rem); | ||
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e"); | ||
background-repeat: no-repeat; | ||
background-position: right calc(0.375em + 0.1875rem) center; | ||
background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem); | ||
animation: shake 150ms 2 linear; | ||
-moz-animation: shake 150ms 2 linear; | ||
-webkit-animation: shake 150ms 2 linear; | ||
-o-animation: shake 150ms 2 linear; | ||
} | ||
.tfa_confirmation_input_button.loading { | ||
cursor: not-allowed; | ||
opacity: 0.7; | ||
padding-right: calc(1.75em + 0.75rem); | ||
background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDov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iB3aWR0aD0iNiIgaGVpZ2h0PSIxMiIgZmlsbD0iI2EzYTNhMyI+CiAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiB2YWx1ZXM9IjE7MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgYmVnaW49IjBzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPgogIDwvcmVjdD4KPC9nPgo8IS0tIFtsZGlvXSBnZW5lcmF0ZWQgYnkgaHR0cHM6Ly9sb2FkaW5nLmlvLyAtLT48L3N2Zz4="); | ||
background-repeat: no-repeat; | ||
background-position: right calc(0.375em + 0.1875rem) center; | ||
background-size: calc(1.5em + 0.375rem) calc(1.5em + 0.375rem); | ||
} | ||
|
||
@media (max-width: 767px) { | ||
.hidden-xs { | ||
display: none !important; | ||
} | ||
|
||
.tfa_confirmation_fieldset { | ||
max-width: 100vh; | ||
} | ||
.tfa_confirmation_fieldset .tfa_confirmation_input_digit { | ||
width: 1.5rem; | ||
height: 1.5rem; | ||
} | ||
|
||
.user_settings .tfa_setting td { | ||
display: block; | ||
} | ||
} | ||
/** | ||
** Shake Annimation Starts Here. | ||
**/ | ||
@keyframes shake { | ||
0% { | ||
transform: translate(3px, 0); | ||
} | ||
50% { | ||
transform: translate(-3px, 0); | ||
} | ||
100% { | ||
transform: translate(0, 0); | ||
} | ||
} | ||
@-moz-keyframes shake { | ||
0% { | ||
-moz-transform: translate(3px, 0); | ||
} | ||
50% { | ||
-moz-transform: translate(-3px, 0); | ||
} | ||
100% { | ||
-moz-transform: translate(0, 0); | ||
} | ||
} | ||
@-webkit-keyframes shake { | ||
0% { | ||
-webkit-transform: translate(3px, 0); | ||
} | ||
50% { | ||
-webkit-transform: translate(-3px, 0); | ||
} | ||
100% { | ||
-webkit-transform: translate(0, 0); | ||
} | ||
} | ||
@-ms-keyframes shake { | ||
0% { | ||
-ms-transform: translate(3px, 0); | ||
} | ||
50% { | ||
-ms-transform: translate(-3px, 0); | ||
} | ||
100% { | ||
-ms-transform: translate(0, 0); | ||
} | ||
} | ||
@-o-keyframes shake { | ||
0% { | ||
-o-transform: translate(3px, 0); | ||
} | ||
50% { | ||
-o-transform: translate(-3px, 0); | ||
} | ||
100% { | ||
-o-transform: translate(0, 0); | ||
} | ||
} | ||
/** | ||
** Shake Annimation Ends Here. | ||
**/ |
Oops, something went wrong.