-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev.ts
executable file
·148 lines (143 loc) · 8.26 KB
/
dev.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
import PlusAuthWidget from './src';
globalThis.PlusAuthWidget = window.PlusAuthWidget = PlusAuthWidget
if (!window.PlusAuth) {
window['PlusAuth'] = {
params: {
ui_locales: 'tr en',
state: '018f00d8-bfd5-731a-b23f-738dfdd28b40'
},
client: {
clientName: 'TestApp',
tosUri: 'https://sometosuri.com',
policyUri: 'https://somepolicyuri.com',
logoUri: 'https://static.plusauth.com/images/logo.png',
social: [
{ name: 'google-connection', provider: 'google' },
{ name: 'facebook-connection', provider: 'facebook' },
]
},
settings: {
register_enabled: true,
forgot_password_enabled: true,
password_policy: {
min: 4,
max: 16,
lower_case: 4,
history: 5
}
},
prompt: {
// mode: 'check_email'
},
// error: {
// error: 'invalid_password'
// },
details: {
// dataUrl: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAADuNJREFUeF7tndGW2zgMQzv//9Hd403P2unYIi8FWs4s+lqaokCApDSJ8/Xr16/fvz7k3+/f56F+fX1JdqDyr/KzbYr6UtlfAXqF9dW61I8kkUInG7MskD+AUnJd5UHlxwIRMr3oygI5AKcitsqPBVJktfAxC8QCQXTyiIXgutdYWZnPIlf5V/lxB7mXX2eruYO4gyAWuoMguO41VlZmd5AXAqrbJ5WfexkVrzbsIHTT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obpu9BfJCjXKIFi8LZGJUoySlAr/rKvlsHUo8ujdVR6BxWiANhO9OgjtI/XDdnRt3kAZB0SplgVggpxyg6v+pbdwCsUCWCER1x0/9UMJT4Y8O6aqi032+ov4ppqou/qNHLEpsSlRVkum6FkhdLhRrC+SANQYP/linqqpZIBYIGskoXPSKkXYiGg8VpgVCEY7POJc5/gkfd6dwWSAxYej4SEVO/dMcq7q1RyyPWKdcogS2QFQSTvhRVfjEUlMmNE5KukpwTyOqKh7qp4Ld2TOlDqJanM72q0BSxWmBxMyhRSf2OGdhgUzgR5NpgcRgU0xjj3MWFsgEfjSZFkgMNsU09jhnYYFM4EeTaYHEYFNMY49zFhbIBH40mRZIDDbFNPY4Z/Gjf2FqDpr608rLBEqYbnvVhQVFl+5L5d8CoUgm7C2QHSQVFhbIBPHuGF0S4f1noiLF5pASo9veHYQw4WZb+lHum8OzQE4AVxULKnya+yv/HrEokgl7FSncQXawLZAJ4nnEqhNJRTyVn6eNcP8ArVHL1OUyEKoAAAAASUVORK5CYII=',
// secret: 'ASFG$E@WRF$ERF$EFG$REG',
merge_context: {
type: 'password',
},
merge_with: {
name: 'test'
},
user: {
name: 'existing user'
},
push_code: '02',
phone_number: '+90********23',
scopes: {
new: ['read:a', 'write:subscription', 'write:user', 'read:user']
},
tenantLoginUrl: 'http://dashboard.plusauth.com',
email: '[email protected]',
fields: [
{
name: 'email',
type: 'text',
format: 'email'
}
],
resent: true,
resend_after: 60000,
challenges: [
'sms',
'email',
'otp',
'sc',
'webauthn',
'fv'
]
}
}
const auth = new PlusAuthWidget('#pa__app', {
locale: {
locales: {
'tr': { label: 'Turkce', codes: ['tr'] },
'en': { label: 'English', codes: ['en'] },
},
defaultLocale: 'en',
dictionary: {
tr: {
errors: {
field_required: 'Alan zorunlu'
},
common: {
edit: 'Degistir'
},
login: {
signIn: 'Giris yap'
}
}
}
},
footer: {
enabled: true
},
// socialLogin: {
// buttonVariant: 'circle' // 'block' by default
// },
modeOptions: {
login: {
fields: {
email: null,
username: {
type: 'text',
label: 'Username',
placeholder: 'Enter your username',
attrs: {
autocomplete: 'email'
},
},
}
},
signup: {
fields: {
username: undefined,
email: {
type: 'text',
label: 'Email',
attrs: {
autocomplete: 'email'
},
},
}
}
}
}, window['PlusAuth'])
// setTimeout(() => {
// auth.view.modeOptions.login!.fields!.username!.value = '[email protected]'
// auth.view.modeOptions.login!.fields = {
// username: null,
// email: {
// type: 'text',
// label: 'Email',
// attrs: {
// autocomplete: 'email'
// },
// },
// }
//
// }, 200)
// auth.view.mode = 'mfapush'
}