change some comments

This commit is contained in:
Asim Aslam
2022-02-09 12:57:13 +00:00
parent e3a83152fe
commit d86514de46
3 changed files with 41 additions and 19 deletions

View File

@@ -257,7 +257,7 @@ func (s *User) VerifyEmail(ctx context.Context, req *pb.VerifyEmailRequest, rsp
return errors.BadRequest("user.verifyemail", "missing email")
}
if len(req.Token) == 0 {
return errors.BadRequest("user.verifyemail", "missing token")
return errors.BadRequest("user.verifytoken", "missing token")
}
// check the token exists

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.19.1
// protoc v3.15.6
// source: proto/user.proto
package user
@@ -1073,10 +1073,12 @@ type VerifyEmailRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// the unique id assigned to the verification process
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// the email address to verify
Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
// The token from the verification email
Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
}
func (x *VerifyEmailRequest) Reset() {
@@ -1111,6 +1113,13 @@ func (*VerifyEmailRequest) Descriptor() ([]byte, []int) {
return file_proto_user_proto_rawDescGZIP(), []int{18}
}
func (x *VerifyEmailRequest) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *VerifyEmailRequest) GetEmail() string {
if x != nil {
return x.Email
@@ -1163,6 +1172,13 @@ func (*VerifyEmailResponse) Descriptor() ([]byte, []int) {
return file_proto_user_proto_rawDescGZIP(), []int{19}
}
// Send a verification email to a user.
// Email "from" will be 'noreply@email.m3ocontent.com'.
// The verification link will be injected in the email
// as a template variable, $micro_verification_link e.g
// 'Welcome to M3O! Use the link below to verify your email: $micro_verification_link'
// The variable will be replaced with a url similar to:
// 'https://user.m3o.com/user/verify?token=a-verification-token&redirectUrl=your-redir-url'
type SendVerificationEmailRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -1174,8 +1190,10 @@ type SendVerificationEmailRequest struct {
Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"`
// Text content of the email. Don't forget to include the string '$micro_verification_link' which will be replaced by the real verification link
// HTML emails are not available currently.
TextContent string `protobuf:"bytes,3,opt,name=textContent,proto3" json:"textContent,omitempty"`
RedirectUrl string `protobuf:"bytes,4,opt,name=redirectUrl,proto3" json:"redirectUrl,omitempty"`
TextContent string `protobuf:"bytes,3,opt,name=textContent,proto3" json:"textContent,omitempty"`
// The url to redirect to after successful verification
RedirectUrl string `protobuf:"bytes,4,opt,name=redirectUrl,proto3" json:"redirectUrl,omitempty"`
// The url to redirect to incase of failure
FailureRedirectUrl string `protobuf:"bytes,5,opt,name=failureRedirectUrl,proto3" json:"failureRedirectUrl,omitempty"`
// Display name of the sender for the email. Note: the email address will still be 'noreply@email.m3ocontent.com'
FromName string `protobuf:"bytes,6,opt,name=fromName,proto3" json:"fromName,omitempty"`
@@ -1983,10 +2001,11 @@ var file_proto_user_proto_rawDesc = []byte{
0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22,
0x10, 0x0a, 0x0e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x22, 0x40, 0x0a, 0x12, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x0a,
0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f,
0x65, 0x22, 0x50, 0x0a, 0x12, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x0a,
0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f,
0x6b, 0x65, 0x6e, 0x22, 0x15, 0x0a, 0x13, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x45, 0x6d, 0x61,
0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xde, 0x01, 0x0a, 0x1c, 0x53,
0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45,

View File

@@ -163,24 +163,25 @@ message LogoutResponse {
// Verify the email address of an account from a token sent in an email to the user.
message VerifyEmailRequest {
// the unique id assigned to the verification process
string id = 1;
// the email address to verify
string email = 1;
string email = 2;
// The token from the verification email
string token = 2;
string token = 3;
}
message VerifyEmailResponse{
}
// Send a verification email
// to the user being signed up. Email from will be from 'noreply@email.m3ocontent.com',
// but you can provide the title and contents.
// The verification link will be injected in to the email as a template variable, $micro_verification_link.
// Example: 'Hi there, welcome onboard! Use the link below to verify your email: $micro_verification_link'
// The variable will be replaced with an actual url that will look similar to this:
// Send a verification email to a user.
// Email "from" will be 'noreply@email.m3ocontent.com'.
// The verification link will be injected in the email
// as a template variable, $micro_verification_link e.g
// 'Welcome to M3O! Use the link below to verify your email: $micro_verification_link'
// The variable will be replaced with a url similar to:
// 'https://user.m3o.com/user/verify?token=a-verification-token&redirectUrl=your-redir-url'
message SendVerificationEmailRequest{
// email address to send the verification code
string email = 1;
@@ -189,7 +190,9 @@ message SendVerificationEmailRequest{
// Text content of the email. Don't forget to include the string '$micro_verification_link' which will be replaced by the real verification link
// HTML emails are not available currently.
string textContent = 3;
// The url to redirect to after successful verification
string redirectUrl = 4;
// The url to redirect to incase of failure
string failureRedirectUrl = 5;
// Display name of the sender for the email. Note: the email address will still be 'noreply@email.m3ocontent.com'
string fromName = 6;