Cotter
Blog
Dashboard
Get help on Slack π
Searchβ¦
0.1.0
π
Getting Started
Features & Concepts
π
Quickstart Guides
All Guides & Tutorials
HTML β Sign in with Email/Phone
React β Sign in with Email/Phone
React β WebAuthn
β² Next.js
Angular
Webflow
Bubble.io
Python SDK for a CLI
React Native β Sign in with Device
iOS β Sign in with Device
Flutter β Sign in with Device
π
SDK Reference
Web
React Native
Flutter
Sign In with Device
Sign in with Email/Phone Number
Getting the Logged-in User
Getting OAuth Tokens
Signing a User Out
iOS
Android
Python (for CLI)
API for Other Mobile Apps or CLI
Backend: Handling Response
π‘οΈ Protecting Your Account
Only Allow Your Website/App to Use Your API Key
Rate Limit
Enable reCAPTCHA to Protect Against Automated Abuse
ποΈ Getting Access Token
Cotter's OAuth 2.0 Tokens Specification
Getting the Tokens
Storing and Removing Tokens
Renewing Expired Tokens
Verifying JWT Tokens
Requesting Custom Fields on your JWT Token
Older API
π
API Reference
User API
OAuth Tokens API
OAuth Tokens from Social Login
Event Object
Reset PIN API
Older API
Validating Cotter's Identity Token
Validating Cotter's Event Response
Powered By
GitBook
Signing a User Out
This page shows you how to log your users out of your application
Using our logout function
We provide a simple logout function that signs out the currently logged in user. Here's how to use it:
1
Cotter
cotter
=
new
Cotter
(
apiKeyID
:
YOUR_API_KEY_ID
);
2
void
yourLogoutFunction
()
async
{
3
await
cotter
.
logOut
();
4
_goToLoginPage
();
// your own logic after logging out
5
}
Copied!
What does `logOut` do ?
It clears out OAuth tokens inside the device's secure storage. The cleared out items include:
1.
Access Token
2.
Refresh Token
3.
ID Token
4.
Token Type
β
β
Previous
Getting OAuth Tokens
Next - SDK Reference
iOS
Last modified
1yr ago
Copy link
Contents
Using our logout function