@@ -133,7 +133,7 @@ created account to get access to your services, but instead can access all the f
133
133
134
134
## Show verification after successful registration
135
135
136
- If you want to show the verification screen after registration, follow these steps:
136
+ If you want to show the verification screen after registration or login , follow these steps:
137
137
138
138
``` mdx-code-block
139
139
<Tabs>
@@ -201,3 +201,80 @@ verification is enabled and the identity schema defines at least one verifiable
201
201
</TabItem>
202
202
</Tabs>
203
203
```
204
+
205
+ ## Show verification after login if address is not verified yet
206
+
207
+ If you want to show the verification screen after login, if any of the user's addresses are not verified yet, add the
208
+ ` verification ` hook to the login after hooks.
209
+
210
+ Using the [ Ory CLI] ( ../../guides/cli/01_installation.mdx ) :
211
+
212
+ ``` shell
213
+ ory patch identity-config {project_id} \
214
+ --add ' /selfservice/flows/registration/after/password/hooks=[{"hook": "verification"}]' \
215
+ --add ' /selfservice/flows/registration/after/oidc/hooks=[{"hook": "verification"}]' \
216
+ --add ' /selfservice/flows/registration/after/webauthn/hooks=[{"hook": "verification"}]'
217
+ ```
218
+
219
+ To automatically show the verification screen in server rendered browser flows, add the ` show_verification_ui ` hook as well:
220
+
221
+ ``` mdx-code-block
222
+ <Tabs>
223
+ <TabItem value="Server rendered browser client">
224
+ ```
225
+
226
+ Using the [ Ory CLI] ( ../../guides/cli/01_installation.mdx ) :
227
+
228
+ ``` shell
229
+ ory patch identity-config {project_id} \
230
+ --add ' /selfservice/flows/registration/after/password/hooks=[{"hook": "show_verification_ui"}]' \
231
+ --add ' /selfservice/flows/registration/after/oidc/hooks=[{"hook": "show_verification_ui"}]' \
232
+ --add ' /selfservice/flows/registration/after/webauthn/hooks=[{"hook": "show_verification_ui"}]'
233
+ ```
234
+
235
+ :::note
236
+
237
+ If your identity schema defines multiple verifiable addresses, Ory Identities redirects to the verification flow of only one of
238
+ the addresses.
239
+
240
+ :::
241
+
242
+ ``` mdx-code-block
243
+ </TabItem>
244
+ <TabItem value="SPA & Native clients">
245
+ ```
246
+
247
+ For SPA and native clients, the response from the registration endpoint contains a ` continue_with ` field. This field lists
248
+ possible actions, the user might need to or can take next. For example, an object containing the ID of the verification flow
249
+ created as part of the registration flow:
250
+
251
+ ``` json
252
+ {
253
+ "continue_with" : [
254
+ {
255
+ "action" : " show_verification_ui" ,
256
+ "flow" : {
257
+ "id" : " d859f6af-1dfe-453e-9320-d572e10edeea" ,
258
+ "verifiable_address" :
" [email protected] "
259
+ }
260
+ }
261
+ // Other items
262
+ ]
263
+ }
264
+ ```
265
+
266
+ You can use this ID to fetch the verification flow information, using the
267
+ [ ` getVerificationFlow ` ] ( ../../reference/api#tag/frontend/operation/getVerificationFlow ) API method.
268
+
269
+ :::note
270
+
271
+ The response from the registration endpoint always contains the ` continue_with ` field with the ` verification_ui ` action, if
272
+ verification is enabled and the identity schema defines at least one verifiable address. Because of this, the
273
+ ` show_verification_ui ` hook has no effect for API and SPA clients.
274
+
275
+ :::
276
+
277
+ ``` mdx-code-block
278
+ </TabItem>
279
+ </Tabs>
280
+ ```
0 commit comments