You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ving/docs/subsystems/ui.md
+22
Original file line number
Diff line number
Diff line change
@@ -377,6 +377,28 @@ It also triggers 2 window events for when the user logs in or out.
377
377
});
378
378
```
379
379
380
+
#### Extended Functionality
381
+
`useCurrentUser()` as all the same functionality as the `useVingRecord()` composable, but also has a few extra methods:
382
+
383
+
##### login()
384
+
Logs in a user.
385
+
386
+
##### logout()
387
+
Logs out a user.
388
+
389
+
##### isRole(role)
390
+
Returns `true` if the current user has the specified role.
391
+
392
+
##### isaRole(roles)
393
+
Returns `true` if the current user has any of the specified roles.
394
+
395
+
##### sendVerifyEmail(redirectAfter)
396
+
Sends a verification email to the user. If `redirectAfter` is passed in, then the user will be redirected to that URL after they verify their email.
397
+
398
+
##### verifyEmail(verify)
399
+
Verifies a user's email. If `verify` is passed in, then the user will be redirected to that URL after they verify their email.
400
+
401
+
380
402
381
403
### useMessageBus()
382
404
Connects the browser to the server's [message bus](messagebus). It establishes a connection between your browser and the server, so it needs to be installed in an `onMounted()` handler in your layouts.
0 commit comments