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: solidstart/github-oauth: update to current versions #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

greglearns
Copy link

The current main version of solidstart/github-oauth does not run with the current main code. This PR fixes that so that the example runs correctly, making the minimum necessary changes to bring the code up-to-date. The changes were manually tested and confirmed.

@@ -1,25 +1,26 @@
{
"name": "username-and-password",
"name": "solidstart-github-oauth",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert this change to make it consistent with the other examples?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted.

});

declare module "vinxi/server" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is context.Locals typed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In createMiddleware, I updated the code to add a type declaration to the event: FetchEvent so that the types will be more clear to anyone looking at the code.

To answer your question, event.locals is of type RequestEventLocals, which is of type:

export interface RequestEventLocals {
    [key: string | symbol]: any;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no way to override the RequestEventLocals type?

Copy link
Author

@greglearns greglearns Oct 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code added to overide/clarify the RequestEventLocals type addition.

(Oh my gosh...on a different, funny tangential note, re-reading this thread before I submit my comment... I suddenly had a surreal feeling just now that this thread sounds a little like a ChatGPT code interaction :-) Then I thought, "I am not a LLM!", but then I though, "Would anyone know if I were?" Like a reverse Turing test! I really am a human.)(And since text doesn't communicate emotion or intention, I'm laughing as I write this!) (By the way, this is a great chance for me to thank you for Artic, Oslo, and your re-purposing Lucia as an education opportunity. I really appreciate it, and I thank you. I agree with your decision about Lucia, and it has benefited me. I'm glad that I'm able to give back in this little way of providing some code back to you.).

@greglearns greglearns force-pushed the fix-solidstart-github-oauth branch 9 times, most recently from 4634c41 to 9f9fe67 Compare October 20, 2024 18:13
@greglearns greglearns force-pushed the fix-solidstart-github-oauth branch from 9f9fe67 to 9f483b3 Compare October 20, 2024 18:15
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