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

feat: added token storage support #104

Merged
merged 1 commit into from
Jun 13, 2024
Merged

feat: added token storage support #104

merged 1 commit into from
Jun 13, 2024

Conversation

manchenkoff
Copy link
Owner

@manchenkoff manchenkoff commented Jun 12, 2024

Is your PR related to a specific issue/feature? Please describe and mention issues.

Closes #33 by supporting Bearer token authentication as well as a Cookie-based approach.

Now users can choose which authentication mode to use:

  • cookie
  • token

By default, token mode enables cookie-based storage, that keeps an auth token in the cookies available for both CSR and SSR requests without further code changes.

When custom storage is needed, users should define their own token storage handler in app.config.ts and implement custom logic based on the needs (Capacitor, Ionic, LocalStorage, etc)

Additional context

To work with token API also should be changed accordingly to return a proper JSON response, right now Login endpoint expects:

{
  "token": "token_value"
}

Checklist:

  • Code style and linters are passing
  • Backwards compatibility is maintained
  • Requires documentation to be updated

@manchenkoff manchenkoff self-assigned this Jun 12, 2024
@manchenkoff manchenkoff linked an issue Jun 12, 2024 that may be closed by this pull request
@manchenkoff
Copy link
Owner Author

manchenkoff commented Jun 12, 2024

  • TODO: Update documentation for v0.4 (examples from breeze-nuxt / breeze-api)
  • TODO: Update breeze-nuxt
  • TODO: Update breeze-api

@manchenkoff manchenkoff merged commit a713d89 into main Jun 13, 2024
1 check passed
@manchenkoff manchenkoff deleted the 33-token-based-auth branch June 13, 2024 22:41
@jjjrmy
Copy link

jjjrmy commented Jun 13, 2024

Thankyou!!!

@manchenkoff
Copy link
Owner Author

Version 0.4 will be released later today as well as documentation

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.

[Feature] Token based authentication support
2 participants