From ba897a34d5a7d7f48482bf7e10de43618d309f33 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Wed, 13 May 2020 16:14:40 +0800 Subject: [PATCH] Improve logout description --- README.md | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 2ef4898af..94c71ceb1 100644 --- a/README.md +++ b/README.md @@ -143,38 +143,9 @@ function App() { #### 4. Implement the logout process -```js -// App.js - -import { View, Button } from 'react-native'; -import appleAuth, { - AppleAuthRequestOperation, - AppleAuthCredentialState, -} from '@invertase/react-native-apple-authentication'; - -async function onLogout() { - // performs logout request - const appleAuthRequestResponse = await appleAuth.performRequest({ - requestedOperation: AppleAuthRequestOperation.LOGOUT, - }); +There is an operation `AppleAuthRequestOperation.LOGOUT`, however it does not work as expected and is not even being used by Apple in their example code. See [this issue for more information](https://github.com/invertase/react-native-apple-authentication/issues/10#issuecomment-611532131) - // get current authentication state for user - const credentialState = await appleAuth.getCredentialStateForUser(appleAuthRequestResponse.user); - - // use credentialState response to ensure the user credential's have been revoked - if (credentialState === AppleAuthCredentialState.REVOKED) { - // user is unauthenticated - } -} - -function App() { - return ( - - - - ); -} -``` +So it is recommended when logging out to just clear all data you have from a user, collected during `AppleAuthRequestOperation.LOGIN`. ## API Reference Documentation