AppFlowy-IO / AppFlowy-Cloud

AppFlowy is an open-source alternative to Notion. You are in charge of your data and customizations. Built with Flutter and Rust.
GNU Affero General Public License v3.0
1.06k stars 227 forks source link

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

Open duypv opened 6 days ago

duypv commented 6 days ago

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,

speed2exe commented 15 hours ago

@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 commented 15 hours ago

you mean it need to be same value?

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

speed2exe commented 14 hours ago

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