Skip to content

Feature: Added useDirectusAuthHook for State-Based Authentication #364

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

Merged
merged 13 commits into from
Jul 31, 2023

Conversation

Fritsch-Tech
Copy link
Collaborator

@Fritsch-Tech Fritsch-Tech commented Jul 29, 2023

🔧 Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Codebase improvement
  • Other (if none of the other choices apply)

🚨 Checklist

  • I've read the guidelines for contributing
  • I've added necessary documentation (if appropriate)
  • I've ensured that my code additions do not fail linting or unit tests (if applicable)

Description

This pull request introduces a new feature, useDirectusAuthHook, which enables React state-based access to the current user and authentication state. The hook provides convenient methods for direct login and logout, utilizing the context-based states.

The following changes have been made:

  1. useDirectusAuthHook: The new hook has been implemented to manage user authentication state and user information, allowing easier and more flexible access to this data within the application.

  2. Direct Login and Logout Methods: The hook includes direct login and logout methods that work seamlessly with the context-based states, simplifying the authentication process.

This feature enhances the overall user experience and provides developers with a more intuitive way to handle authentication within the application. Furthermore, it will seamlessly integrate with the authentication system of the components once it's introduced.

Please review the changes and provide feedback.

Thank you for considering this pull request, and I look forward to your valuable feedback!

@Fritsch-Tech Fritsch-Tech changed the title Auth hooks Feature: Added useDirectusAuthHook for State-Based Authentication Jul 30, 2023
@gremo
Copy link
Owner

gremo commented Jul 30, 2023

Does the README should be updated too to document the usage?

@Fritsch-Tech
Copy link
Collaborator Author

I thought about updating the README, but I wanted your input in regards to #360 first. In case we adopt the automatic documentation generation the TSDoc string and add a link to the doc file in the README it would be sufficient.

@gremo
Copy link
Owner

gremo commented Jul 31, 2023

#360 seems big, I honestly don't know how TSDoc generation works. Would you mind add a few lines in the README, so we can merge this? Then we move to the next PR? 😄

@Fritsch-Tech
Copy link
Collaborator Author

No Problem.

@gremo gremo merged commit 554442b into gremo:main Jul 31, 2023
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.

3 participants