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

Login code not send #595

Open
medach2000 opened this issue Apr 22, 2024 · 13 comments
Open

Login code not send #595

medach2000 opened this issue Apr 22, 2024 · 13 comments

Comments

@medach2000
Copy link

When I enter my email, the login code not send inbox.

@kushsharma
Copy link
Member

@medach2000 have you configured mailer daemon? Try getting a test account from mailtrap and set the values in frontier, for example if using env vars:

- FRONTIER_APP_MAILER_SMTP_HOST=sandbox.smtp.mailtrap.io
- FRONTIER_APP_MAILER_SMTP_PORT=2525
- FRONTIER_APP_MAILER_SMTP_USERNAME=get it from mail trap
- FRONTIER_APP_MAILER_SMTP_PASSWORD=get it from mail trap
- [email protected]

Mailtrap only send emails on their dashboard, use resend if you want to test it by sending email on actual email account.

@medach2000
Copy link
Author

how can I set the values in frontier ?

@kushsharma
Copy link
Member

How are you running it? You can set it by either passing a config file or by environment variables.
https://raystack-frontier.vercel.app/configurations

@medach2000
Copy link
Author

I clone the project, then i run docker-compose up

@kushsharma
Copy link
Member

You can use environment variables I shared above in docker compose for frontier service to configure mailer. Just copy paste them and update with respective values.

@medach2000
Copy link
Author

ok it works but when I put my email, i receive the code, when I put the code , I receive Unauthorized.
How can I access the application ?

@kushsharma
Copy link
Member

When do you receive this error? Are you trying to access UI? Did you put your email in?

Note, the UI is still in very early stages. I would advice to interact with frontier via APIs only. You can find all APIs in documentation.

@medach2000
Copy link
Author

Yes, I put my email to access UI, I want to see Frontier's interfaces

@shivani446
Copy link

Hello @kushsharma I am adding the env in the compose.. u shared above...but still I am not able to get the code out of it ..the smtp service is working fine

@kushsharma
Copy link
Member

@shivani446 can you share the docker compose file you are using to test it? Omit the username/password value.

@shivani446
Copy link

Sure @kushsharma


services:
  pg:
    image: postgres:13
    environment:
      - POSTGRES_DB=frontier
      - POSTGRES_USER=frontier
      - POSTGRES_HOST_AUTH_METHOD=trust
    volumes:
      - ./temp/pgdata:/var/lib/postgresql/data
    ports:
      - "5432:5432"
    healthcheck:
      test: [ "CMD-SHELL", "pg_isready -U frontier" ]
      interval: 30s
      timeout: 30s
      retries: 3

  pg2:
    image: "postgres:13"
    environment:
      POSTGRES_USER: "spicedb"
      POSTGRES_DB: "spicedb"
      POSTGRES_HOST_AUTH_METHOD: "trust"
    volumes:
      - ./temp/pgdata2:/var/lib/postgresql/data
    ports:
      - "5431:5432"
    healthcheck:
      test: [ "CMD-SHELL", "pg_isready -U spicedb" ]
      interval: 30s
      timeout: 30s
      retries: 3

  frontier-migrate:
    build:
      context: .
      dockerfile: Dockerfile.dev
    command: ["server", "migrate"]
    restart: on-failure
    depends_on:
      pg:
        condition: service_healthy
    environment:
      - FRONTIER_DB_DRIVER=postgres
      - FRONTIER_DB_URL=postgres://frontier:@pg:5432/frontier?sslmode=disable
      - FRONTIER_SPICEDB_PORT=50051
      - FRONTIER_SPICEDB_HOST=spicedb
      - FRONTIER_SPICEDB_PRE_SHARED_KEY=frontier

  frontier:
    build:
      context: .
      dockerfile: Dockerfile.dev
    ports:
      - "8081:8080" # rest endpoint
      - "8082:8081" # grpc endpoint
      - "8083:8083" # ui
    command: ["server", "start"]
    restart: on-failure
    depends_on:
      pg:
        condition: service_healthy
      frontier-migrate:
        condition: service_completed_successfully
    environment:
      - FRONTIER_DB_DRIVER=postgres
      - FRONTIER_DB_URL=postgres://frontier:@pg:5432/frontier?sslmode=disable
      - FRONTIER_SPICEDB_PORT=50051
      - FRONTIER_SPICEDB_HOST=spicedb
      - FRONTIER_SPICEDB_PRE_SHARED_KEY=frontier
      - FRONTIER_APP_RESOURCES_CONFIG_PATH=file:///opt
      - FRONTIER_UI_PORT=8083
      - FRONTIER_APP_MAILER_SMTP_HOST=****
      - FRONTIER_APP_MAILER_SMTP_PORT=****
      - FRONTIER_APP_MAILER_SMTP_USERNAME=****
      - FRONTIER_APP_MAILER_SMTP_PASSWORD=****
      - FRONTIER_APP_MAILER_SMTP_INSECURE=false
      - FRONTIER_APP_MAILER_SMTP_TLS_POLICY=mandatory  # possible values are "mandatory", "opportunistic", or "none"
      - FRONTIER_APP_ADMIN_USERS=***


  spicedb-migration:
    image: quay.io/authzed/spicedb:v1.29.2
    command: migrate head --datastore-engine postgres --datastore-conn-uri postgres://spicedb:@pg2:5432/spicedb?sslmode=disable
    restart: on-failure
    depends_on:
      pg2:
        condition: service_healthy

  spicedb:
    image: quay.io/authzed/spicedb:v1.29.2
    ports:
      - "7443:8443"
      - "50051:50051"
    command:
      serve --grpc-preshared-key "frontier" --datastore-engine postgres
      --datastore-conn-uri postgres://spicedb:@pg2:5432/spicedb?sslmode=disable --http-enabled=true
    restart: on-failure
    depends_on:
      pg2:
        condition: service_healthy
      spicedb-migration:
        condition: service_completed_successfully

@kushsharma
Copy link
Member

@shivani446 the config looks alright, can you try FRONTIER_APP_MAILER_SMTP_TLS_POLICY=none also do you see any error in logs?
When you say but still I am not able to get the code out of it what APIs are you trying to get the code? Are you trying to open admin console? Can you try the sample flow provided in docs for Email OTP via Postman or Curl?

@shivani446
Copy link

@kushsharma I am not getting any error logs also the u tried FRONTIER_APP_MAILER_SMTP_TLS_POLICY=none but still its the same ..here code means the verification number we get from the email ..i will try from the link u sent and will get back to u here ...Thanks

@ravisuhag ravisuhag moved this to 2024 in Roadmap Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 2024
Development

No branches or pull requests

3 participants