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

[Bug] Can't invite user to workspace #973

Open
duypv opened this issue Nov 8, 2024 · 11 comments
Open

[Bug] Can't invite user to workspace #973

duypv opened this issue Nov 8, 2024 · 11 comments
Assignees

Comments

@duypv
Copy link

duypv commented Nov 8, 2024

Describe the bug
Can't invite user to workspace

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Invite another user to your workspace'
  2. Type email
  3. Click on 'Invite'
  4. See error

Screenshots
image

Log gotrue:
{
"component": "api",
"error": "this token needs to have one of the following roles: service_role, supabase_admin",
"level": "info",
"method": "POST",
"msg": "this token needs to have one of the following roles: service_role, supabase_admin",
"path": "/admin/generate_link",
"referer": "appflowy-flutter://",
"remote_addr": "172.23.0.4",
"request_id": "a73e40f6-1499-4497-8066-7a3b17870c7d",
"time": "2024-11-08T05:42:51Z"
}

Log Applowy cloud
{
"timestamp": "2024-11-08T04:56:44.118907Z",
"level": "ERROR",
"fields": {
"error": "User not allowed"
},
"target": "appflowy_cloud::api::workspace",
"filename": "src/api/workspace.rs",
"line_number": 329,

@duypv duypv changed the title [Bug] Untitled Bug Issue [Bug] Can't invite user to workspace Nov 8, 2024
@speed2exe
Copy link
Collaborator

@duypv You need be using admin email for the following env:

APPFLOWY_MAILER_SMTP_USERNAME=
APPFLOWY_MAILER_SMTP_PASSWORD=

which can be the same as:

GOTRUE_ADMIN_EMAIL=
GOTRUE_ADMIN_PASSWORD=

@duypv
Copy link
Author

duypv commented Nov 14, 2024

you mean it need to be same value?

Right now, magic link work but I can't invite other user.

@speed2exe
Copy link
Collaborator

speed2exe commented Nov 14, 2024

@duypv Yes, you can use the same value (copy from GOTRUE_ADMIN_EMAIL to APPFLOWY_MAILER_SMTP_USERNAME).

@sylarevan
Copy link

sylarevan commented Nov 29, 2024

Just saw this issue. I still have an error with email invitation, though I'm correctly setting APPFLOWY_MAILER_SMTP_* values, see #553 (comment)

@nicksas
Copy link

nicksas commented Dec 2, 2024

Hi, have you found a solution?

@speed2exe
Copy link
Collaborator

I'm unable to reproduce this issue. Do check that the following env var is set correctly:

GOTRUE_SMTP_ADMIN_EMAIL
GOTRUE_SMTP_USER
GOTRUE_SMTP_PASS
GOTRUE_SMTP_PORT
GOTRUE_SMTP_HOST

You may also inspect the logs in gotrue service.
Do note that you should have APPFLOWY_WEB_URL unset. If it is set, the email will be attempted to send from appflowy_cloud instead of gotrue.

@speed2exe
Copy link
Collaborator

@duypv Are you still facing this issue? The only way I can think of scenario in the above is where you have logged in as a non-admin user, but you somehow manage to get into the admin page /web/admin/home, for which even though you can see the functionalities, it will not allow you to perform any of the actions due to permission. It could be also you have logged in to another non-admin user from another tab, you can resolve this by logging out and logging in again.

@duypv
Copy link
Author

duypv commented Dec 5, 2024

yes, please note magic link work normal. But invite mail to workspace don't work. So I don't think SMTP config is reason.

@speed2exe
Copy link
Collaborator

@duypv invite to workspace do you mean in the "invite" section? on the left panel of non-admin user?

@duypv
Copy link
Author

duypv commented Dec 5, 2024

on both: desktop app and admin ui. No email sent.

@speed2exe
Copy link
Collaborator

@duypv you actually dont need email for workspace invitation to work(it's for notification and convenience). you can have the invitee to login to your self host cloud web/login, go to "invite" section, you should see it in the pending invite section

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

No branches or pull requests

4 participants