Skip to content

Fix: auth error auto redirect & tree-sitter load path & toast notification #101

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 5 commits into from
Nov 29, 2022

Conversation

li-xin-yi
Copy link
Collaborator

@li-xin-yi li-xin-yi commented Nov 28, 2022

  1. When you haven't logged in, show the error message and auto redirect to login page:

image

  1. When you access a repo that you are not supposed to be there (e.g., a private repo where you are neither an author or collaborator, or a wrong URL), show the error message and auto redirect to your dashboard page.

image

  1. Fix the load path issue in parser, otherwise, a user can't enter a repo by URL directly. Thanks to @lihebi , but it doesn't promise the parser ready for analyzing code when you directly jump to a repo by URL. We may modify more code to support waiting for the loading in the future.

  2. Fix the bug that a public repo can't be created. (But I think the UI can be improved, it looks a little misleading)

image

  1. Change the notification in share project dialog into toast style, which is auto hidden is 3 seconds in the bottom-left of a page. So the success message can also be left alone for a while after auto closing the dialog.

image

image

close #77

Comment on lines +83 to +84
{ id, owner: { id: userId || "undefined"} },
{ id, collaboratorIds: { has: userId || "undefined"} },
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the purpose of the string "undefined" here?

Copy link
Collaborator Author

@li-xin-yi li-xin-yi Nov 29, 2022

Choose a reason for hiding this comment

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

When a guest visits a public repo, the userId could be null, but we should still return the repo. Though OR relationship may be short-circuited by the condition public==true, a null userId still causes a type error for the following two conditions. (Yes, we can check the public field first and then start another query, but it may bring overhead)

Copy link
Collaborator

@lihebi lihebi left a comment

Choose a reason for hiding this comment

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

Thanks!

@lihebi lihebi merged commit ac76a47 into codepod-io:main Nov 29, 2022
@li-xin-yi li-xin-yi deleted the fix/auth_error_redirect branch December 13, 2022 22:19
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.

Log-in page by default for users not logged in
2 participants