This repository has been archived by the owner on Jan 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: provide a singleton Clerk instance as the the default export, a…
…llow usage of a sub-api directly, make all options configurable in a consistent manner
- Loading branch information
1 parent
02c68ec
commit 82c5354
Showing
25 changed files
with
399 additions
and
219 deletions.
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
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { RestClient } from '../utils/RestClient'; | ||
|
||
export abstract class AbstractApi { | ||
restClient: RestClient; | ||
protected _restClient: RestClient; | ||
|
||
constructor(restClient: RestClient) { | ||
this.restClient = restClient; | ||
this._restClient = restClient; | ||
} | ||
} |
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
const { requireSession } = require('@clerk/clerk-sdk-node'); | ||
import clerk, { requireSession } from '@clerk/clerk-sdk-node'; | ||
|
||
function handler(req, res) { | ||
console.log('Session required'); | ||
res.statusCode = 200; | ||
res.json(req.session || { empty: true }); | ||
} | ||
|
||
export default requireSession(handler, { serverApiUrl: process.env.CLERK_API_URL, onError: error => console.log(error) }); | ||
export default requireSession(handler, { clerk, onError: error => console.log(error) }); |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
const { withSession } = require('@clerk/clerk-sdk-node'); | ||
import clerk, { withSession } from '@clerk/clerk-sdk-node'; | ||
|
||
function handler(req, res) { | ||
console.log('Session optional'); | ||
res.statusCode = 200; | ||
res.json(req.session || { empty: true }); | ||
} | ||
|
||
export default withSession(handler, { serverApiUrl: process.env.CLERK_API_URL, onError: error => console.log(error) }); | ||
export default withSession(handler, { clerk, onError: error => console.log(error) }); |
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
Oops, something went wrong.