feat: 🎸 Remove required personal number on login on same device (#271)
* feat: 🎸 Remove required personal number on login on same device
When using the same device for BankId, personal number is not required.
You use the autostarttoken to bind it together.
Update embedded api to 4.4.0
This commit is contained in:
parent
243e9806f7
commit
260464026b
|
@ -120,9 +120,14 @@ export const Login = () => {
|
|||
const startLogin = async (text: string) => {
|
||||
if (loginMethodIndex < 2) {
|
||||
showModal(true)
|
||||
const ssn = Personnummer.parse(text).format(true)
|
||||
setCachedSsn(ssn)
|
||||
setSocialSecurityNumber(ssn)
|
||||
|
||||
let ssn
|
||||
if (loginMethodIndex === 1) {
|
||||
ssn = Personnummer.parse(text).format(true)
|
||||
setCachedSsn(ssn)
|
||||
setSocialSecurityNumber(ssn)
|
||||
}
|
||||
|
||||
const status = await api.login(ssn)
|
||||
setCancelLoginRequest(() => () => status.cancel())
|
||||
if (status.token !== 'fake' && loginMethodIndex === 0) {
|
||||
|
@ -144,7 +149,7 @@ export const Login = () => {
|
|||
<>
|
||||
<Image source={require('../assets/boys.png')} style={styles.image} />
|
||||
<View style={styles.loginForm}>
|
||||
{loginMethodIndex !== 2 && (
|
||||
{loginMethodIndex === 1 && (
|
||||
<Input
|
||||
label={translate('general.socialSecurityNumber')}
|
||||
autoFocus
|
||||
|
@ -168,7 +173,7 @@ export const Login = () => {
|
|||
onPress={() => startLogin(socialSecurityNumber)}
|
||||
style={styles.loginButton}
|
||||
appearance="ghost"
|
||||
disabled={loginMethodIndex !== 2 && !valid}
|
||||
disabled={loginMethodIndex === 1 && !valid}
|
||||
status="primary"
|
||||
accessoryLeft={SecureIcon}
|
||||
size="medium"
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
"@react-navigation/native": "5.9.4",
|
||||
"@react-navigation/stack": "5.14.4",
|
||||
"@skolplattformen/api-hooks": "2.1.0",
|
||||
"@skolplattformen/embedded-api": "4.3.0",
|
||||
"@skolplattformen/embedded-api": "4.4.0",
|
||||
"@ui-kitten/components": "5.0.0",
|
||||
"@ui-kitten/eva-icons": "5.0.0",
|
||||
"buffer": "6.0.3",
|
||||
|
|
|
@ -1500,10 +1500,10 @@
|
|||
resolved "https://registry.yarnpkg.com/@skolplattformen/curriculum/-/curriculum-1.2.0.tgz#f6975bf241c09e05bb81f3493ac7cf35aa23d6c4"
|
||||
integrity sha512-26/R+ZN1P0jrH26xVrn6ue8WxDPag/TRWqEKyMckSbPWFUpuDRv7/FXRF3q4cRIIowvus6V4L63y3u4ao7Yj3A==
|
||||
|
||||
"@skolplattformen/embedded-api@4.3.0":
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@skolplattformen/embedded-api/-/embedded-api-4.3.0.tgz#e76b0fe3511e969d8108cff7d809e9f0f0d834da"
|
||||
integrity sha512-z9qVhW9z67Wcyos1r0oG8hNW0ChUVcrWyBo3y6KjisejFoUeUD4+YMDXhZolzeg+sxxeoTfwwUwmrEywurCZIg==
|
||||
"@skolplattformen/embedded-api@4.4.0":
|
||||
version "4.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@skolplattformen/embedded-api/-/embedded-api-4.4.0.tgz#668a0c05cd7b94edfeee02dfebe859a823b68669"
|
||||
integrity sha512-oU6mCsMfHE7U42SYMhjlL2tHRkt4vehIiuN2a0gNOUqdkeL3/xhH2EDFds2ae2Jh1NVcczMASQxctggOiFs4zQ==
|
||||
dependencies:
|
||||
"@skolplattformen/curriculum" "^1.2.0"
|
||||
"@types/he" "^1.1.1"
|
||||
|
|
Loading…
Reference in New Issue