Skip to content

Commit 1952705

Browse files
committed
fix: readme
1 parent 70c8353 commit 1952705

File tree

1 file changed

+32
-27
lines changed

1 file changed

+32
-27
lines changed

README.md

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
Authorizer
88
</h1>
99

10-
1110
**Authorizer** is an open-source authentication and authorization solution for your applications. Bring your database and have complete control over the user information. You can self-host authorizer instances and connect to any SQL database.
1211

1312
## Table of contents
13+
1414
- [Introduction](#introduction)
1515
- [Getting Started](#getting-started)
1616
- [Contributing](https://github.com/authorizerdev/authorizer/blob/main/.github/CONTRIBUTING.md)
@@ -65,9 +65,13 @@
6565

6666
## Trying out Authorizer
6767

68-
This guide helps you practice using Authorizer to evaluate it before you use it in a production environment. It includes instructions for installing the Authorizer server in standalone mode.
68+
This guide helps you practice using Authorizer to evaluate it before you use it in a production environment. It includes instructions for installing the Authorizer server in local or standalone mode.
6969

70-
## Trying out locally using the code base
70+
- [Install using source code](#install-using-source-code)
71+
- [Install using binaries](#install-using-binaries)
72+
- [Install instance on heroku](#install-instance-on-Heroku)
73+
74+
## Install using source code
7175

7276
### Prerequisites
7377

@@ -84,7 +88,7 @@ This guide helps you practice using Authorizer to evaluate it before you use it
8488
> Note: if you don't have [`make`](https://www.ibm.com/docs/en/aix/7.2?topic=concepts-make-command), you can `cd` into `server` dir and build using the `go build` command
8589
6. Run binary `./build/server`
8690

87-
## Trying out locally using binaries
91+
## Install using binaries
8892

8993
Deploy / Try Authorizer using binaries. With each [Authorizer Release](https://github.com/authorizerdev/authorizer/releases)
9094
binaries are baked with required deployment files and bundled. You can download a specific version of it for the following operating systems:
@@ -93,7 +97,6 @@ binaries are baked with required deployment files and bundled. You can download
9397
- Linux
9498
- Windows
9599

96-
97100
### Step 1: Download and unzip bundle
98101

99102
- Download the Bundle for the specific OS from the [release page](https://github.com/authorizerdev/authorizer/releases)
@@ -127,20 +130,22 @@ Required environment variables are pre-configured in `.env` file. But based on t
127130
### Step 3: Start Authorizer
128131

129132
- Run following command to start authorizer
133+
130134
- For Mac / Linux users
131135

132136
```sh
133137
./build/server
134138
```
135-
139+
136140
- For windows
141+
137142
```sh
138143
./build/server.exe
139144
```
140145

141146
> Note: For mac users, you might have to give binary the permission to execute. Here is the command you can use to grant permission `xattr -d com.apple.quarantine build/server`
142147
143-
## Installing a simple instance of Authorizer on Heroku
148+
## Install instance on Heroku
144149

145150
Deploy Authorizer using [heroku](https://github.com/authorizerdev/authorizer-heroku) and quickly play with it in 30seconds
146151
<br/><br/>
@@ -165,30 +170,30 @@ This example demonstrates how you can use [`@authorizerdev/authorizer-js`](/auth
165170
<script src="https://unpkg.com/@authorizerdev/authorizer-js/lib/authorizer.min.js"></script>
166171

167172
<script type="text/javascript">
168-
const authorizerRef = new authorizerdev.Authorizer({
169-
authorizerURL: `AUTHORIZER_URL`,
170-
redirectURL: window.location.origin,
171-
});
172-
173-
// use the button selector as per your application
174-
const logoutBtn = document.getElementById("logout");
175-
logoutBtn.addEventListener("click", async function () {
176-
await authorizerRef.logout();
177-
window.location.href = "/";
178-
});
179-
180-
async function onLoad() {
181-
const res = await authorizerRef.fingertipLogin();
182-
if (res && res.user) {
183-
// you can use user information here, eg:
184-
/**
173+
const authorizerRef = new authorizerdev.Authorizer({
174+
authorizerURL: `AUTHORIZER_URL`,
175+
redirectURL: window.location.origin,
176+
});
177+
178+
// use the button selector as per your application
179+
const logoutBtn = document.getElementById('logout');
180+
logoutBtn.addEventListener('click', async function () {
181+
await authorizerRef.logout();
182+
window.location.href = '/';
183+
});
184+
185+
async function onLoad() {
186+
const res = await authorizerRef.fingertipLogin();
187+
if (res && res.user) {
188+
// you can use user information here, eg:
189+
/**
185190
const userSection = document.getElementById('user');
186191
const logoutSection = document.getElementById('logout-section');
187192
logoutSection.classList.toggle('hide');
188193
userSection.innerHTML = `Welcome, ${res.user.email}`;
189194
*/
190-
}
191-
}
192-
onLoad();
195+
}
196+
}
197+
onLoad();
193198
</script>
194199
```

0 commit comments

Comments
 (0)