From cb0c202aad208ec4fffbbd62d215a4857887c790 Mon Sep 17 00:00:00 2001 From: Daniel Joudat Date: Mon, 13 Dec 2021 19:08:26 +0300 Subject: [PATCH] Fix panic sendmagiclink (#326) * add two rpcs to User service: - Passwordless: endpoint that receives an email, topic and an optional message - PasswordlessML: endpoint that receives token and topic via MagicLink. * Proposal to add Passwordless login feature to the endpoint user. * remove currency run check * Commit from GitHub Actions (Publish APIs & Clients) * Create downstream.yml * Commit from GitHub Actions (Publish APIs & Clients) * update todo * Commit from GitHub Actions (Publish APIs & Clients) * Update publish.yml * Commit from GitHub Actions (Publish APIs & Clients) * Update publish.yml * Commit from GitHub Actions (Publish APIs & Clients) * Update and rename publish.yml to generate.yml * Update generate.yml * Commit from GitHub Actions (Generate Clients & Examples) * Commit from GitHub Actions (Generate Clients & Examples) * add comments * Commit from GitHub Actions (Generate Clients & Examples) * move otp to auth category * charge for user verification * Commit from GitHub Actions (Generate Clients & Examples) * Update user.proto * Commit from GitHub Actions (Generate Clients & Examples) * Commit from GitHub Actions (Generate Clients & Examples) * Change js client git repo url (#249) * Commit from GitHub Actions (Generate Clients & Examples) * use tableName func for Count * Commit from GitHub Actions (Generate Clients & Examples) * update notes example * Commit from GitHub Actions (Generate Clients & Examples) * Update .gitignore * Update .gitignore * Commit from GitHub Actions (Generate Clients & Examples) * add new endpoints SendMagicLink and VerifyToken to M3O user serivce Signed-off-by: Daniel Joudat * fix panic in user.SendMagicLink Signed-off-by: Daniel Joudat Co-authored-by: Asim Aslam Co-authored-by: asim Co-authored-by: Janos Dobronszki Co-authored-by: crufter --- user/handler/handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user/handler/handler.go b/user/handler/handler.go index 1fba694..cac0129 100644 --- a/user/handler/handler.go +++ b/user/handler/handler.go @@ -404,7 +404,7 @@ func (s *User) SendMagicLink(ctx context.Context, req *pb.SendMagicLinkRequest, // check if the email exist in the DB users, err := s.domain.Search(ctx, "", req.Email) - if err.Error() == "not found" { + if err != nil && err.Error() == "not found" { return errors.BadRequest("SendMagicLink.email-check", "email doesn't exist") } else if err != nil { return errors.BadRequest("SendMagicLink.email-check", err.Error())