Skip to content

Commit a9b688d

Browse files
committed
fix format
1 parent e861a02 commit a9b688d

File tree

30 files changed

+64
-38
lines changed

30 files changed

+64
-38
lines changed

.github/lock.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
ignoreUnless: {{ STALE_BOT }}
2+
ignoreUnless: { { STALE_BOT } }
33
---
44
# Configuration for Lock Threads - https://github.com/dessant/lock-threads-app
55

.github/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
ignoreUnless: {{ STALE_BOT }}
2+
ignoreUnless: { { STALE_BOT } }
33
---
44
# Number of days of inactivity before an issue becomes stale
55
daysUntilStale: 60

MANUAL.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# Manual class setup to support supabase
22

3-
## Install this dependencies:
3+
## Install this dependencies:
4+
45
- `@adonisjs/auth`, [documentation](https://docs.adonisjs.com/guides/authentication/introduction#installation)
56
- `@supabase/supabase-js`, [documentation](https://supabase.com/docs/reference/javascript/introduction)
67
- `jsonwebtoken`, [package](https://www.npmjs.com/package/jsonwebtoken)
78
- `@types/jsonwebtoken`, [package](https://www.npmjs.com/package/@types/jsonwebtoken)
89

910
## Copy the code below in `app/auth/guards/supabase_jwt_guard.ts`
11+
1012
```ts
1113
import { errors, symbols } from '@adonisjs/auth'
1214
import { AuthClientResponse, GuardContract } from '@adonisjs/auth/types'
@@ -171,6 +173,7 @@ export interface CustomSupabaseJwtPayload extends JwtPayload {
171173
```
172174

173175
## Copy the code below in `app/utils/supabase_util.ts`
176+
174177
```ts
175178
import env from '#start/env'
176179
import { createClient } from '@supabase/supabase-js'
@@ -181,6 +184,7 @@ export { supabase }
181184
```
182185

183186
## Add environment variable in `start/env.ts`
187+
184188
```ts
185189
export default await Env.create(new URL('../', import.meta.url), {
186190
[...]
@@ -190,6 +194,7 @@ export default await Env.create(new URL('../', import.meta.url), {
190194
```
191195

192196
## Update `adonisjs/auth` configuration (`config/auth.ts`)
197+
193198
```ts
194199
import { SupabaseJwtGuard } from '../app/auth/guards/supabase_jwt_guard.js'
195200
[...]
@@ -207,4 +212,5 @@ const authConfig = defineConfig({
207212
},
208213
})
209214

210-
export default authConfig
215+
export default authConfig
216+
```

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ node ace configure @killian-fal/adonisjs-supabase-auth
2727
## Usage
2828

2929
To protect a route, simply use the authentication middleware:
30+
3031
```ts
3132
import { middleware } from './kernel.js'
3233

@@ -38,13 +39,15 @@ router
3839
```
3940

4041
or:
42+
4143
```ts
4244
router
4345
.group(() => {[...]})
4446
.use([middleware.auth()])
4547
```
4648

4749
Then, it is possible to get the user:
50+
4851
```ts
4952
async foo({ auth }: HttpContext) {
5053
const user = auth.getUserOrFail() // type: CustomSupabaseUser defined in the guard
@@ -62,4 +65,5 @@ A list of examples is available [here](samples/) to show the possible implementa
6265
4. **with-both-and-role-based:** version combining the above 2 samples, adding a decorator to build a role access based application - [README](samples/with-both-and-role-based/README.md)
6366

6467
## License
65-
This project is Open Source software released under the [MIT license.](LICENSE.md)
68+
69+
This project is Open Source software released under the [MIT license.](LICENSE.md)

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
"@adonisjs/auth": "^9.3.0",
6363
"@adonisjs/core": "^6.2.0",
6464
"@supabase/supabase-js": "^2.47.10",
65-
"jsonwebtoken": "^9.0.2",
66-
"@types/jsonwebtoken": "^9.0.7"
65+
"@types/jsonwebtoken": "^9.0.7",
66+
"jsonwebtoken": "^9.0.2"
6767
},
6868
"publishConfig": {
6969
"access": "public",

samples/classic/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Classic version
22

3-
This version doesn't modify the code provided by the package. It just add an `auth.spec.ts` test that shows how to test routes that are **secure with supabase**.
3+
This version doesn't modify the code provided by the package. It just add an `auth.spec.ts` test that shows how to test routes that are **secure with supabase**.

samples/classic/adonisrc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default defineConfig({
3131
() => import('@adonisjs/core/providers/vinejs_provider'),
3232
() => import('@adonisjs/cors/cors_provider'),
3333
() => import('@adonisjs/lucid/database_provider'),
34-
() => import('@adonisjs/auth/auth_provider')
34+
() => import('@adonisjs/auth/auth_provider'),
3535
],
3636

3737
/*

samples/classic/app/middleware/auth_middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ export default class AuthMiddleware {
2222
await ctx.auth.authenticateUsing(options.guards, { loginRoute: this.redirectTo })
2323
return next()
2424
}
25-
}
25+
}

samples/classic/app/models/user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ export default class User extends compose(BaseModel, AuthFinder) {
3030
declare updatedAt: DateTime | null
3131

3232
static accessTokens = DbAccessTokensProvider.forModel(User)
33-
}
33+
}

samples/classic/config/database.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const dbConfig = defineConfig({
77
sqlite: {
88
client: 'better-sqlite3',
99
connection: {
10-
filename: app.tmpPath('db.sqlite3')
10+
filename: app.tmpPath('db.sqlite3'),
1111
},
1212
useNullAsDefault: true,
1313
migrations: {
@@ -18,4 +18,4 @@ const dbConfig = defineConfig({
1818
},
1919
})
2020

21-
export default dbConfig
21+
export default dbConfig

0 commit comments

Comments
 (0)