Skip to content

Commit

Permalink
Merge branch 'openauthjs:master' into bsky
Browse files Browse the repository at this point in the history
  • Loading branch information
5brian authored Dec 11, 2024
2 parents bc4297b + 400c88a commit b39e56b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
5 changes: 0 additions & 5 deletions .changeset/tasty-bulldogs-retire.md

This file was deleted.

7 changes: 7 additions & 0 deletions packages/openauth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openauthjs/openauth

## 0.0.25

### Patch Changes

- 7e3fa38: feat(cognito): add CognitoAdapter
- f496e3a: Set input autocomplete attribute in password UI

## 0.0.24

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/openauth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openauthjs/openauth",
"version": "0.0.24",
"version": "0.0.25",
"type": "module",
"scripts": {
"build": "bun run script/build.ts"
Expand Down
19 changes: 19 additions & 0 deletions packages/openauth/src/adapter/cognito.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Oauth2Adapter, Oauth2WrappedConfig } from "./oauth2.js"

export interface CognitoConfig extends Oauth2WrappedConfig {
domain: string
region: string
}

export function CognitoAdapter(config: CognitoConfig) {
const domain = `${config.domain}.auth.${config.region}.amazoncognito.com`

return Oauth2Adapter({
type: "cognito",
...config,
endpoint: {
authorization: `https://${domain}/oauth2/authorize`,
token: `https://${domain}/oauth2/token`,
},
})
}

0 comments on commit b39e56b

Please sign in to comment.