This repository has been archived by the owner on Sep 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 117
Split auth guide, add label, team, and password security to docs. #412
Merged
Merged
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
459a5e2
Add some new pages for different auth methods.
fce9b60
Add auth method pages.
286867e
Add homepage list of auth methods
c4e6f15
Add tags for engineers to add examples
ff3c2b4
Fix web example format, add quickstart to auth
21431cc
Fix auth index, add users api docs
672a6df
Fix auth index display names
8050091
Maybe it should be user management vs just management
e2f493e
grammar check by GPT
f1a41d2
Add info about personal information in auth docs
61be417
Add more information about password security in Appwrite
e58af23
Improve Examples
PineappleIOnic 9921120
user management docs
36a5b6b
OAuth docs additions with steven's comments
e52ae93
Merge branch 'feat-auth-improvements' of https://github.com/appwrite/…
a5b28d6
ChatGPT grammar check
47dd971
Where applicable, prefer promises because it's copyable.
7d01bd4
Personal Information -> Data
cda41f5
address OAuth2 issues like redirect
a4eac31
improve getting started guide because we should
3eaa246
Apply suggestions from code review
56213ec
Fix code example errors and other items pointed out during review
f06a4b6
Merge branch 'feat-auth-improvements' of https://github.com/appwrite/…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
<p> | ||
Anonymous sessions allow you to implement guest users. | ||
Guest users let you store user information like items in their cart or theme preferences before they create an account. | ||
This reduces the friction for your users to get started with your app. | ||
</p> | ||
|
||
<p> | ||
If a user <b>later creates an account</b>, their information will be inherited by the newly created account. | ||
</p> | ||
|
||
<h2><a href="#createSession" id="createSession">Create Anonymous Session</a></h2> | ||
<p> | ||
Create an anonymous session with <a href="/docs/client/account#accountCreateAnonymousSession">Create Anonymous Session</a> route. | ||
</p> | ||
|
||
|
||
<ul class="phases clear" data-ui-phases> | ||
<li> | ||
<h3>Web</h3> | ||
<div class="ide" data-lang="javascript" data-lang-label="Web SDK"> | ||
<pre class="line-numbers"><code class="prism language-javascript" data-prism>import { Client, Account } from "appwrite"; | ||
|
||
const client = new Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('[PROJECT_ID]'); // Your project ID | ||
|
||
const account = new Account(client); | ||
|
||
const promise = account.createAnonymousSession(); | ||
|
||
promise.then(function (response) { | ||
console.log(response); // Success | ||
}, function (error) { | ||
console.log(error); // Failure | ||
});</code></pre> | ||
</div> | ||
</li> | ||
<li> | ||
<h3>Flutter</h3> | ||
<div class="ide" data-lang="dart" data-lang-label="Flutter SDK"> | ||
<pre class="line-numbers"><code class="prism language-dart" data-prism>import 'package:appwrite/appwrite.dart'; | ||
|
||
final client = Client() | ||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint | ||
.setProject('[PROJECT_ID]'); // Your project ID | ||
|
||
final account = Account(client); | ||
|
||
final user = await account.createAnonymousSession();</code></pre> | ||
</div> | ||
</li> | ||
<li> | ||
<h3>Android</h3> | ||
<div class="ide" data-lang="kotlin" data-lang-label="Android SDK"> | ||
<pre class="line-numbers"><code class="prism language-kotlin" data-prism>import io.appwrite.Client | ||
import io.appwrite.services.Account | ||
|
||
val client = Client() | ||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint | ||
.setProject("[PROJECT_ID]") // Your project ID | ||
|
||
val account = Account(client) | ||
|
||
val user = account.createAnonymousSession()</code></pre> | ||
</div> | ||
</li> | ||
<li> | ||
<h3>Apple</h3> | ||
<div class="ide" data-lang="swift" data-lang-label="Apple SDK"> | ||
<pre class="line-numbers"><code class="prism language-swift" data-prism>import Appwrite | ||
|
||
let client = Client() | ||
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint | ||
.setProject("[PROJECT_ID]") // Your project ID | ||
|
||
let account = Account(client) | ||
|
||
let user = try await account.createAnonymousSession()</code></pre> | ||
</div> | ||
</li> | ||
<li> | ||
<h3>GraphQL</h3> | ||
<div class="ide" data-lang="graphql" data-lang-label="GraphQL"> | ||
<pre class="line-numbers"><code class="prism language-graphql" data-prism> | ||
mutation { | ||
accountCreateAnonymousSession { | ||
_id | ||
userId | ||
provider | ||
expire | ||
} | ||
}</code></pre> | ||
</div> | ||
</li> | ||
</ul> | ||
|
||
<h2><a href="#attach-account" id="attach-account">Attaching an Account</a></h2> | ||
<p> | ||
Anonymous users cannot sign back in. | ||
If they close their browser, or go to another computer, they won't be able to log in again. | ||
Remember to prompt the user to create an account to not lose their data. | ||
</p> | ||
|
||
<p> | ||
Create an account with any of these methods to transition from an anonymous session to a user account session. | ||
</p> | ||
|
||
|
||
<p> | ||
<a href="/docs/authentication-email-pass"><i class="icon-angle-circled-right margin-start-negative-tiny margin-end-tiny">Email and password</a> | ||
</p> | ||
<p> | ||
<a href="/docs/authentication-sms"><i class="icon-angle-circled-right margin-start-negative-tiny margin-end-tiny">Phone (SMS)</a> | ||
</p> | ||
<p> | ||
<a href="/docs/authentication-magic"><i class="icon-angle-circled-right margin-start-negative-tiny margin-end-tiny">Magic URL</a> | ||
</p> | ||
<p> | ||
<a href="/docs/authentication-oauth"><i class="icon-angle-circled-right margin-start-negative-tiny margin-end-tiny">OAuth2</a> | ||
</p> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Step of closing browser here sounds irelevant. Also would be good to mention here that we store session information in cookies, so clearing browser might also cause sign out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ye