This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package api | |
import ( | |
"context" | |
"go-sms-verification/data" | |
"net/http" | |
"time" | |
"github.com/gin-gonic/gin" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package api | |
import ( | |
"github.com/twilio/twilio-go" | |
twilioApi "github.com/twilio/twilio-go/rest/verify/v2" | |
) | |
var client *twilio.RestClient = twilio.NewRestClientWithParams(twilio.ClientParams{ | |
Username: envACCOUNTSID(), | |
Password: envAUTHTOKEN(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package api | |
import ( | |
"net/http" | |
"github.com/gin-gonic/gin" | |
"github.com/go-playground/validator/v10" | |
) | |
type jsonResponse struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package api | |
import "github.com/gin-gonic/gin" | |
type Config struct { | |
Router *gin.Engine | |
} | |
func (app *Config) Routes() { | |
//routes will come here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package data | |
type OTPData struct { | |
PhoneNumber string `json:"phoneNumber,omitempty" validate:"required"` | |
} | |
type VerifyData struct { | |
User *OTPData `json:"user,omitempty" validate:"required"` | |
Code string `json:"code,omitempty" validate:"required"` | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package api | |
import ( | |
"log" | |
"os" | |
"github.com/joho/godotenv" | |
) | |
func envACCOUNTSID() string { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use yew::prelude::*; | |
mod components; | |
mod models; | |
use gloo_net::{http::Request, Error}; //add | |
use models::user::Users; //add | |
use components::{card::Card, header::Header, loader::Loader, message::Message}; //add |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub mod user; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub mod header; | |
pub mod loader; | |
pub mod card; | |
pub mod message; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use yew::prelude::*; | |
use crate::models::user::User; | |
#[derive(Properties, PartialEq)] | |
pub struct CardProp { | |
pub user: User, | |
} | |
#[function_component(Card)] | |
pub fn card(CardProp { user }: &CardProp) -> Html { |