Skip to content

Commit

Permalink
Merge pull request #20 from bzr-sys/docs_update
Browse files Browse the repository at this point in the history
Update docs
  • Loading branch information
saschat authored May 29, 2024
2 parents 737d349 + 9b70b6a commit f5a3810
Show file tree
Hide file tree
Showing 9 changed files with 2,361 additions and 1,984 deletions.
3,467 changes: 1,853 additions & 1,614 deletions package-lock.json

Large diffs are not rendered by default.

29 changes: 11 additions & 18 deletions src/content/docs/docs/features/auth.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
title: Auth
title: Authentication
---

import { Tabs, TabItem } from "@astrojs/starlight/components";

Bazaar provides authentication out-of-the-box allowing you to create and authenticate users securely and easily.

Authorization is provided with the [Sharing API](/docs/features/sharing).
Authorization is provided with the [Permissions API](/docs/features/permissions).

## Sign up and Log in

Expand All @@ -18,23 +16,18 @@ bzr.login();

Calling the `login` method opens a pop-up window by default, which falls back to redirect login if the pop-up fails to open.

Login types `popup_fallback`, `popup`, and `redirect` can be optionally set:
Optionally, you can set a login type:

<Tabs>
<TabItem label="JS">
```js
bzr.login({ type: "redirect" });
```
</TabItem>
<TabItem label="TS">
```ts
import { LoginType } from "@bzr/bazaar";
```ts
import { LoginType } from "@bzr/bazaar";
bzr.login({ type: LoginType.REDIRECT });
```

bzr.login({ type: LoginType.REDIRECT});
```
Available `LoginType` are

</TabItem>
</Tabs>
- `POPUP_FALLBACK`: Complete auth in a popup window but fall back to redirect if popup creation fails (default).
- `POPUP`: Complete auth in a popup window.
- `REDIRECT`: Complete auth via a redirect. This may case the site to loose context (temporary, unsaved data).

## Log Out

Expand Down
Loading

0 comments on commit f5a3810

Please sign in to comment.