Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: UserSession secure type augmentation #181

Merged
merged 2 commits into from
Sep 19, 2024
Merged

Conversation

IsraelOrtuno
Copy link
Contributor

@IsraelOrtuno IsraelOrtuno commented Sep 16, 2024

Seems like secure type (https://github.com/atinux/nuxt-auth-utils/blob/main/src/runtime/types/session.ts#L14) can't be augmented just like in #54. This PR extracts the secure property type to a separated interface SecureSessionData that allows augmentation/overriding the default typings.

This would allow to add better typing to the secure property:

// auth.d.ts
declare module '#auth-utils' {
  interface SecureSessionData {
    token: string
  }
}

export {}

@atinux atinux merged commit 125ea11 into atinux:main Sep 19, 2024
@atinux
Copy link
Owner

atinux commented Sep 19, 2024

Thank you, and you updated the readme too ❤️

atinux pushed a commit to Gerbuuun/nuxt-auth-utils that referenced this pull request Sep 25, 2024
* fix: UserSession secure type augmentation

* docs: add readme example
atinux added a commit that referenced this pull request Sep 30, 2024
* feat: add passkey specific webauthn authentication support

* feat: playground passkey implementation

* feat: initial docs

* fix: composable type and availability functions

* fix: types and webauthn config functions

* fix: auto import

* fix: composable jsdoc

* feat: handle attempts internally and change config to respective options name

* chore: update README.md

* fix: make sure attempt is always removed from storage!

* chore: make playground implementation more consistent

* refactor: use 'webauthn' and 'credential' terms instead of 'passkey'

* refactor: use body instead of query param for `attemptId`

* chore: rename passkey terms

* chore: improvements

* up

* lint fix

* feat: use session to store challenge by default

* feat: base64 encode publicKey by default

* chore: types cleanup and typo fixes

* feat: improve example and documentation

* chore: proofread readme

* fix: typo

* docs: add frontend example

* docs: fix typo

Change useServerSession() to useUserSession()

* refactor: request token

* refactor: request token

* chore: fix import

* up

* up

* Merge branch 'main' into refactor/request-token

* [autofix.ci] apply automated fixes

* chore: fix types issue

* chore: lint

---------

Co-authored-by: Sébastien Chopin <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* feat: add tiktok provider

* feat: add tiktok provider

* docs: add tiktok

* feat: add tiktok .env example

* chore: remove console logs

* [autofix.ci] apply automated fixes

* chore: remove unused authorizationParams

* chore: use new utils

* fix: extends from RequestAccesTokenBody interface

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* chore: update deps

* chore(release): v0.3.6

* fix: paypal tokens request requires encoded `redirect_uri`

* fix: encode paypal `redirect_uri`

* chore: add comment

* chore: update deps

* chore(release): v0.3.7

* docs: add note about cookie size

* feat: add Gitlab provider

* feat: add yandex oauth

* chore: linting

* update: change FormData to URLSearchParams & add config.emailRequired

* up

* [autofix.ci] apply automated fixes

* chore(release): v0.2.0

* style: add lint script

* style: add lint script

* ci: update lint fix command

* [autofix.ci] apply automated fixes

* feat: add gitlab provider

* [autofix.ci] apply automated fixes

* update Supported OAuth Providers in readme

* Apply suggestions from code review

---------

Co-authored-by: Sébastien Chopin <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Estéban <[email protected]>
Co-authored-by: Sébastien Chopin <[email protected]>

* docs: Add note to readme about session API route

* Add note about session API route

* Update README.md

* Update README.md

---------

Co-authored-by: Sébastien Chopin <[email protected]>

* feat: add instagram provider

* feat(instagram): new provider

* chore(instagram): add provider to readme

* fix(instagram): oauth query

---------

Co-authored-by: Sébastien Chopin <[email protected]>

* chore: add emailRequired for testing Gitlab

* feat: add vk provider

* feat: add yandex oauth

* chore: linting

* update: change FormData to URLSearchParams & add config.emailRequired

* up

* [autofix.ci] apply automated fixes

* chore(release): v0.2.0

* style: add lint script

* style: add lint script

* ci: update lint fix command

* [autofix.ci] apply automated fixes

* feat: add gitlab provider

* [autofix.ci] apply automated fixes

* update Supported OAuth Providers in readme

* feat: add vk provider

* [autofix.ci] apply automated fixes

* up

---------

Co-authored-by: Sébastien Chopin <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Estéban <[email protected]>

* fix: ensure plugin declaration files are emitted (#170)

* feat: add support for private data & config argument (#171)

* chore: up

* chore(release): v0.3.8

* fix: UserSession secure type augmentation (#181)

* fix: UserSession secure type augmentation

* docs: add readme example

* chore: update deps

* chore(release): v0.3.9

* feat: add Dropbox as supported oauth provider (#183)

* feat: add Dropbox as supported oauth provider

* chore: remove no needed config

* fix(steam): improve open id validation (#184)

* fix(steam): open id validation

* chore: lint

* chore: check steam id

* [autofix.ci] apply automated fixes

* chore: update error message

* chore: adjust steam id checker

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* feat!: call `fetch` hook if session is not empty instead of user defined (#188)

* feat!: rename `oauth<Provider>EventHandler` to`defineOAuth<Provider>EventHandler` (#189)

* up

* lint fix

* up

* type error

* [autofix.ci] apply automated fixes

* fix all types

* [autofix.ci] apply automated fixes

* chore: use logger

* [autofix.ci] apply automated fixes

* Update autofix.yml

* rename to useWebAuthn

* [autofix.ci] apply automated fixes

* update readme

* [autofix.ci] apply automated fixes

* feat: allow for extra data fields to be included in the registration body

* [autofix.ci] apply automated fixes

* fix: component name

* Update autofix.yml

* chore: update

* up

* chore: fix types

* add validateUser method

* chore: small update

* add allowCredentials and improve validateUser

* lint

* feat: infer registration body and credential data

* chore: remove unnecessary generic param

* chore: add demo

---------

Co-authored-by: Sébastien Chopin <[email protected]>
Co-authored-by: Ivailo Panamski <[email protected]>
Co-authored-by: Estéban <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Ahmed Rangel <[email protected]>
Co-authored-by: Yizack Rangel <[email protected]>
Co-authored-by: Alex Blumgart <[email protected]>
Co-authored-by: Estéban <[email protected]>
Co-authored-by: Sébastien Chopin <[email protected]>
Co-authored-by: Rudo Kemper <[email protected]>
Co-authored-by: Sandro Circi <[email protected]>
Co-authored-by: Daniel Roe <[email protected]>
Co-authored-by: Israel Ortuño <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants