diff --git a/LICENSE b/LICENSE index 42f84fb..c3030d9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 yauthio +Copyright (c) 2021 authorizer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 15a7831..b67adc1 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -# yauth +#authorizer -yauth (aka your-auth) is a complete open source authentication and authorization solution for your applications. Bring your database and have complete control over the authentication, authorization and user data. It is a microservice that can be deployed anywhere and connected any sql database. +authorizer (aka your-auth) is a complete open source authentication and authorization solution for your applications. Bring your database and have complete control over the authentication, authorization and user data. It is a microservice that can be deployed anywhere and connected any sql database. This an [Auth0](https://auth0.com) opensource alternative. -Deploy YAuth Server with Postgres DB on Heroku and get a YAuth GraphQL endpoint in under 30 seconds +Deploy authorizer Server with Postgres DB on Heroku and get a authorizer GraphQL endpoint in under 30 seconds [![Deploy to -Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/yauthdev/yauth-heroku) +Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/authorizerdev/authorizer-heroku) ## Features ### Flexible and easy to use @@ -38,5 +38,5 @@ Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy? * Advanced options allow you to define your own routines to handle controlling what accounts are allowed to sign in, for encoding and decoding JSON Web Tokens and to set custom cookie security policies and session properties, so you can control who is able to sign in and how often sessions have to be re-validated. # License -[MIT](https://github.com/yauthio/yauth/blob/main/LICENSE) +[MIT](https://github.com/authorizerdev/authorizer/blob/main/LICENSE) diff --git a/ROADMAP.md b/ROADMAP.md index d2374f0..9ce680e 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,4 +1,4 @@ -# Roadmap for yauth.io +# Roadmap for authorizer This document contains detailed information about the project scope and future roadmap @@ -43,9 +43,9 @@ This document contains detailed information about the project scope and future r - [ ] Allow user to view users - [ ] Allow user to define the JWT token field - [x] A component library for react - - [x] Create YAuthProvider -> gives token, user, loading, setters - - [x] Create YAuth component -> Complete Login/Signup & Forgot password solution - - [x] Create YAuthResetPassword component -> Component that can be used to verify forgot password token and reset the password + - [x] Create AuthorizerProvider -> gives token, user, loading, setters + - [x] Create Authorizer component -> Complete Login/Signup & Forgot password solution + - [x] Create AuthorizerResetPassword component -> Component that can be used to verify forgot password token and reset the password - [ ] Create a sdks - [ ] NodeJS sdk which acts as a middleware and can be used to authenticate & authorize users - [ ] Golang sdk which acts as a middleware and can be used to authenticate & authorize users diff --git a/docker-compose.yaml b/docker-compose.yaml index 093f123..880c5e0 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -10,8 +10,8 @@ services: - POSTGRES_PASSWORD=postgres ports: - 5432:5432 - yauth: - image: lakhansamani/yauth:0.1.0-beta.0 + authorizer: + image: lakhansamani/authorizer:0.1.0-beta.0 ports: - 8080:8080 depends_on: diff --git a/server/constants/env.go b/server/constants/env.go index 0a9c27e..98a60ca 100644 --- a/server/constants/env.go +++ b/server/constants/env.go @@ -6,12 +6,12 @@ import ( "os" "strings" + "github.com/authorizerdev/authorizer/server/enum" "github.com/joho/godotenv" - "github.com/yauthdev/yauth/server/enum" ) var ( - YAUTH_ADMIN_SECRET = "" + ROOT_SECRET = "" ENV = "" DB_TYPE = "" DB_URL = "" @@ -55,7 +55,7 @@ func init() { if err != nil { log.Println("Error loading .env file") } - YAUTH_ADMIN_SECRET = os.Getenv("YAUTH_ADMIN_SECRET") + ROOT_SECRET = os.Getenv("ROOT_SECRET") ENV = os.Getenv("ENV") DB_TYPE = os.Getenv("DB_TYPE") DB_URL = os.Getenv("DB_URL") @@ -78,8 +78,8 @@ func init() { // FACEBOOK_CLIENT_SECRET = os.Getenv("FACEBOOK_CLIENT_SECRET") FORGOT_PASSWORD_URI = strings.TrimPrefix(os.Getenv("FORGOT_PASSWORD_URI"), "/") VERIFY_EMAIL_URI = strings.TrimPrefix(os.Getenv("VERIFY_EMAIL_URI"), "/") - if YAUTH_ADMIN_SECRET == "" { - panic("Yauth admin secret is required") + if ROOT_SECRET == "" { + panic("Root admin secret is required") } if ENV == "" { @@ -107,7 +107,7 @@ func init() { } if COOKIE_NAME == "" { - COOKIE_NAME = "yauth" + COOKIE_NAME = "authorizer" } if SERVER_URL == "" { diff --git a/server/db/db.go b/server/db/db.go index 6685f3b..632eff7 100644 --- a/server/db/db.go +++ b/server/db/db.go @@ -3,8 +3,8 @@ package db import ( "log" - "github.com/yauthdev/yauth/server/constants" - "github.com/yauthdev/yauth/server/enum" + "github.com/authorizerdev/authorizer/server/constants" + "github.com/authorizerdev/authorizer/server/enum" "gorm.io/driver/mysql" "gorm.io/driver/postgres" "gorm.io/driver/sqlite" @@ -37,7 +37,7 @@ func init() { log.Println("=> from db:", constants.DB_TYPE, constants.DB_URL) ormConfig := &gorm.Config{ NamingStrategy: schema.NamingStrategy{ - TablePrefix: "yauth_", + TablePrefix: "authorizer_", }, } if constants.DB_TYPE == enum.Postgres.String() { diff --git a/server/email/email.go b/server/email/email.go index 99c8912..9e7a8c9 100644 --- a/server/email/email.go +++ b/server/email/email.go @@ -8,7 +8,7 @@ import ( "net/smtp" "strings" - "github.com/yauthdev/yauth/server/constants" + "github.com/authorizerdev/authorizer/server/constants" ) /** diff --git a/server/go.mod b/server/go.mod index ec69149..71bbd59 100644 --- a/server/go.mod +++ b/server/go.mod @@ -1,4 +1,4 @@ -module github.com/yauthdev/yauth/server +module github.com/authorizerdev/authorizer/server go 1.16 diff --git a/server/gqlgen.yml b/server/gqlgen.yml index 1e2d628..2518743 100644 --- a/server/gqlgen.yml +++ b/server/gqlgen.yml @@ -35,7 +35,7 @@ resolver: # gqlgen will search for any type names in the schema in these go packages # if they match it will use them, otherwise it will generate them. autobind: - - 'github.com/yauthdev/yauth/server/graph/model' + - 'github.com/authorizerdev/authorizer/server/graph/model' # This section declares type mapping between the GraphQL and go type systems # diff --git a/server/graph/generated/generated.go b/server/graph/generated/generated.go index ddc2479..c1ee78d 100644 --- a/server/graph/generated/generated.go +++ b/server/graph/generated/generated.go @@ -12,9 +12,9 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" + "github.com/authorizerdev/authorizer/server/graph/model" gqlparser "github.com/vektah/gqlparser/v2" "github.com/vektah/gqlparser/v2/ast" - "github.com/yauthdev/yauth/server/graph/model" ) // region ************************** generated!.gotpl ************************** @@ -39,8 +39,7 @@ type ResolverRoot interface { Query() QueryResolver } -type DirectiveRoot struct { -} +type DirectiveRoot struct{} type ComplexityRoot struct { Error struct { @@ -110,6 +109,7 @@ type MutationResolver interface { ForgotPassword(ctx context.Context, params model.ForgotPasswordInput) (*model.Response, error) ResetPassword(ctx context.Context, params model.ResetPassowrdInput) (*model.Response, error) } + type QueryResolver interface { Users(ctx context.Context) ([]*model.User, error) Token(ctx context.Context) (*model.LoginResponse, error) @@ -3130,7 +3130,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co func (ec *executionContext) unmarshalInputForgotPasswordInput(ctx context.Context, obj interface{}) (model.ForgotPasswordInput, error) { var it model.ForgotPasswordInput - var asMap = obj.(map[string]interface{}) + asMap := obj.(map[string]interface{}) for k, v := range asMap { switch k { @@ -3150,7 +3150,7 @@ func (ec *executionContext) unmarshalInputForgotPasswordInput(ctx context.Contex func (ec *executionContext) unmarshalInputLoginInput(ctx context.Context, obj interface{}) (model.LoginInput, error) { var it model.LoginInput - var asMap = obj.(map[string]interface{}) + asMap := obj.(map[string]interface{}) for k, v := range asMap { switch k { @@ -3178,7 +3178,7 @@ func (ec *executionContext) unmarshalInputLoginInput(ctx context.Context, obj in func (ec *executionContext) unmarshalInputResendVerifyEmailInput(ctx context.Context, obj interface{}) (model.ResendVerifyEmailInput, error) { var it model.ResendVerifyEmailInput - var asMap = obj.(map[string]interface{}) + asMap := obj.(map[string]interface{}) for k, v := range asMap { switch k { @@ -3198,7 +3198,7 @@ func (ec *executionContext) unmarshalInputResendVerifyEmailInput(ctx context.Con func (ec *executionContext) unmarshalInputResetPassowrdInput(ctx context.Context, obj interface{}) (model.ResetPassowrdInput, error) { var it model.ResetPassowrdInput - var asMap = obj.(map[string]interface{}) + asMap := obj.(map[string]interface{}) for k, v := range asMap { switch k { @@ -3234,7 +3234,7 @@ func (ec *executionContext) unmarshalInputResetPassowrdInput(ctx context.Context func (ec *executionContext) unmarshalInputSignUpInput(ctx context.Context, obj interface{}) (model.SignUpInput, error) { var it model.SignUpInput - var asMap = obj.(map[string]interface{}) + asMap := obj.(map[string]interface{}) for k, v := range asMap { switch k { @@ -3294,7 +3294,7 @@ func (ec *executionContext) unmarshalInputSignUpInput(ctx context.Context, obj i func (ec *executionContext) unmarshalInputUpdateProfileInput(ctx context.Context, obj interface{}) (model.UpdateProfileInput, error) { var it model.UpdateProfileInput - var asMap = obj.(map[string]interface{}) + asMap := obj.(map[string]interface{}) for k, v := range asMap { switch k { @@ -3362,7 +3362,7 @@ func (ec *executionContext) unmarshalInputUpdateProfileInput(ctx context.Context func (ec *executionContext) unmarshalInputVerifyEmailInput(ctx context.Context, obj interface{}) (model.VerifyEmailInput, error) { var it model.VerifyEmailInput - var asMap = obj.(map[string]interface{}) + asMap := obj.(map[string]interface{}) for k, v := range asMap { switch k { diff --git a/server/graph/schema.resolvers.go b/server/graph/schema.resolvers.go index b29541c..a19bd72 100644 --- a/server/graph/schema.resolvers.go +++ b/server/graph/schema.resolvers.go @@ -6,9 +6,9 @@ package graph import ( "context" - "github.com/yauthdev/yauth/server/graph/generated" - "github.com/yauthdev/yauth/server/graph/model" - "github.com/yauthdev/yauth/server/resolvers" + "github.com/authorizerdev/authorizer/server/graph/generated" + "github.com/authorizerdev/authorizer/server/graph/model" + "github.com/authorizerdev/authorizer/server/resolvers" ) func (r *mutationResolver) Signup(ctx context.Context, params model.SignUpInput) (*model.Response, error) { @@ -65,5 +65,7 @@ func (r *Resolver) Mutation() generated.MutationResolver { return &mutationResol // Query returns generated.QueryResolver implementation. func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} } -type mutationResolver struct{ *Resolver } -type queryResolver struct{ *Resolver } +type ( + mutationResolver struct{ *Resolver } + queryResolver struct{ *Resolver } +) diff --git a/server/handlers/graphql.go b/server/handlers/graphql.go index 886a5f4..e55323f 100644 --- a/server/handlers/graphql.go +++ b/server/handlers/graphql.go @@ -2,9 +2,9 @@ package handlers import ( "github.com/99designs/gqlgen/graphql/handler" + "github.com/authorizerdev/authorizer/server/graph" + "github.com/authorizerdev/authorizer/server/graph/generated" "github.com/gin-gonic/gin" - "github.com/yauthdev/yauth/server/graph" - "github.com/yauthdev/yauth/server/graph/generated" ) // Defining the Graphql handler diff --git a/server/handlers/oauthCallback.go b/server/handlers/oauthCallback.go index a068622..38375a0 100644 --- a/server/handlers/oauthCallback.go +++ b/server/handlers/oauthCallback.go @@ -8,13 +8,13 @@ import ( "strings" "time" + "github.com/authorizerdev/authorizer/server/constants" + "github.com/authorizerdev/authorizer/server/db" + "github.com/authorizerdev/authorizer/server/enum" + "github.com/authorizerdev/authorizer/server/oauth" + "github.com/authorizerdev/authorizer/server/session" + "github.com/authorizerdev/authorizer/server/utils" "github.com/gin-gonic/gin" - "github.com/yauthdev/yauth/server/constants" - "github.com/yauthdev/yauth/server/db" - "github.com/yauthdev/yauth/server/enum" - "github.com/yauthdev/yauth/server/oauth" - "github.com/yauthdev/yauth/server/session" - "github.com/yauthdev/yauth/server/utils" "golang.org/x/oauth2" ) diff --git a/server/handlers/oauthLogin.go b/server/handlers/oauthLogin.go index c18c61a..8b263ee 100644 --- a/server/handlers/oauthLogin.go +++ b/server/handlers/oauthLogin.go @@ -3,11 +3,11 @@ package handlers import ( "net/http" + "github.com/authorizerdev/authorizer/server/enum" + "github.com/authorizerdev/authorizer/server/oauth" + "github.com/authorizerdev/authorizer/server/session" "github.com/gin-gonic/gin" "github.com/google/uuid" - "github.com/yauthdev/yauth/server/enum" - "github.com/yauthdev/yauth/server/oauth" - "github.com/yauthdev/yauth/server/session" ) func OAuthLoginHandler(provider enum.OAuthProvider) gin.HandlerFunc { diff --git a/server/handlers/verifyEmail.go b/server/handlers/verifyEmail.go index 39f48fb..50fb61b 100644 --- a/server/handlers/verifyEmail.go +++ b/server/handlers/verifyEmail.go @@ -5,12 +5,12 @@ import ( "net/http" "time" + "github.com/authorizerdev/authorizer/server/constants" + "github.com/authorizerdev/authorizer/server/db" + "github.com/authorizerdev/authorizer/server/enum" + "github.com/authorizerdev/authorizer/server/session" + "github.com/authorizerdev/authorizer/server/utils" "github.com/gin-gonic/gin" - "github.com/yauthdev/yauth/server/constants" - "github.com/yauthdev/yauth/server/db" - "github.com/yauthdev/yauth/server/enum" - "github.com/yauthdev/yauth/server/session" - "github.com/yauthdev/yauth/server/utils" ) func VerifyEmailHandler() gin.HandlerFunc { diff --git a/server/oauth/oauth.go b/server/oauth/oauth.go index d1c9d1a..2d84e44 100644 --- a/server/oauth/oauth.go +++ b/server/oauth/oauth.go @@ -1,7 +1,7 @@ package oauth import ( - "github.com/yauthdev/yauth/server/constants" + "github.com/authorizerdev/authorizer/server/constants" "golang.org/x/oauth2" githubOAuth2 "golang.org/x/oauth2/github" googleOAuth2 "golang.org/x/oauth2/google" diff --git a/server/resolvers/forgotPassword.go b/server/resolvers/forgotPassword.go index a70591a..a83debb 100644 --- a/server/resolvers/forgotPassword.go +++ b/server/resolvers/forgotPassword.go @@ -7,10 +7,10 @@ import ( "strings" "time" - "github.com/yauthdev/yauth/server/db" - "github.com/yauthdev/yauth/server/enum" - "github.com/yauthdev/yauth/server/graph/model" - "github.com/yauthdev/yauth/server/utils" + "github.com/authorizerdev/authorizer/server/db" + "github.com/authorizerdev/authorizer/server/enum" + "github.com/authorizerdev/authorizer/server/graph/model" + "github.com/authorizerdev/authorizer/server/utils" ) func ForgotPassword(ctx context.Context, params model.ForgotPasswordInput) (*model.Response, error) { diff --git a/server/resolvers/login.go b/server/resolvers/login.go index e9fb3fb..d86819a 100644 --- a/server/resolvers/login.go +++ b/server/resolvers/login.go @@ -6,11 +6,11 @@ import ( "log" "strings" - "github.com/yauthdev/yauth/server/db" - "github.com/yauthdev/yauth/server/enum" - "github.com/yauthdev/yauth/server/graph/model" - "github.com/yauthdev/yauth/server/session" - "github.com/yauthdev/yauth/server/utils" + "github.com/authorizerdev/authorizer/server/db" + "github.com/authorizerdev/authorizer/server/enum" + "github.com/authorizerdev/authorizer/server/graph/model" + "github.com/authorizerdev/authorizer/server/session" + "github.com/authorizerdev/authorizer/server/utils" "golang.org/x/crypto/bcrypt" ) diff --git a/server/resolvers/logout.go b/server/resolvers/logout.go index ce71c2a..654dcbc 100644 --- a/server/resolvers/logout.go +++ b/server/resolvers/logout.go @@ -3,9 +3,9 @@ package resolvers import ( "context" - "github.com/yauthdev/yauth/server/graph/model" - "github.com/yauthdev/yauth/server/session" - "github.com/yauthdev/yauth/server/utils" + "github.com/authorizerdev/authorizer/server/graph/model" + "github.com/authorizerdev/authorizer/server/session" + "github.com/authorizerdev/authorizer/server/utils" ) func Logout(ctx context.Context) (*model.Response, error) { diff --git a/server/resolvers/profile.go b/server/resolvers/profile.go index 6cf375b..3263fa5 100644 --- a/server/resolvers/profile.go +++ b/server/resolvers/profile.go @@ -4,10 +4,10 @@ import ( "context" "fmt" - "github.com/yauthdev/yauth/server/db" - "github.com/yauthdev/yauth/server/graph/model" - "github.com/yauthdev/yauth/server/session" - "github.com/yauthdev/yauth/server/utils" + "github.com/authorizerdev/authorizer/server/db" + "github.com/authorizerdev/authorizer/server/graph/model" + "github.com/authorizerdev/authorizer/server/session" + "github.com/authorizerdev/authorizer/server/utils" ) func Profile(ctx context.Context) (*model.User, error) { diff --git a/server/resolvers/resendVerifyEmail.go b/server/resolvers/resendVerifyEmail.go index f9e20b4..e37837f 100644 --- a/server/resolvers/resendVerifyEmail.go +++ b/server/resolvers/resendVerifyEmail.go @@ -7,9 +7,9 @@ import ( "strings" "time" - "github.com/yauthdev/yauth/server/db" - "github.com/yauthdev/yauth/server/graph/model" - "github.com/yauthdev/yauth/server/utils" + "github.com/authorizerdev/authorizer/server/db" + "github.com/authorizerdev/authorizer/server/graph/model" + "github.com/authorizerdev/authorizer/server/utils" ) func ResendVerifyEmail(ctx context.Context, params model.ResendVerifyEmailInput) (*model.Response, error) { diff --git a/server/resolvers/resetPassword.go b/server/resolvers/resetPassword.go index 6c09257..d42242d 100644 --- a/server/resolvers/resetPassword.go +++ b/server/resolvers/resetPassword.go @@ -4,9 +4,9 @@ import ( "context" "fmt" - "github.com/yauthdev/yauth/server/db" - "github.com/yauthdev/yauth/server/graph/model" - "github.com/yauthdev/yauth/server/utils" + "github.com/authorizerdev/authorizer/server/db" + "github.com/authorizerdev/authorizer/server/graph/model" + "github.com/authorizerdev/authorizer/server/utils" ) func ResetPassword(ctx context.Context, params model.ResetPassowrdInput) (*model.Response, error) { diff --git a/server/resolvers/signup.go b/server/resolvers/signup.go index 8c9fb7d..359d6a0 100644 --- a/server/resolvers/signup.go +++ b/server/resolvers/signup.go @@ -7,10 +7,10 @@ import ( "strings" "time" - "github.com/yauthdev/yauth/server/db" - "github.com/yauthdev/yauth/server/enum" - "github.com/yauthdev/yauth/server/graph/model" - "github.com/yauthdev/yauth/server/utils" + "github.com/authorizerdev/authorizer/server/db" + "github.com/authorizerdev/authorizer/server/enum" + "github.com/authorizerdev/authorizer/server/graph/model" + "github.com/authorizerdev/authorizer/server/utils" ) func Signup(ctx context.Context, params model.SignUpInput) (*model.Response, error) { diff --git a/server/resolvers/token.go b/server/resolvers/token.go index be62f95..67bda13 100644 --- a/server/resolvers/token.go +++ b/server/resolvers/token.go @@ -5,11 +5,11 @@ import ( "fmt" "time" - "github.com/yauthdev/yauth/server/db" - "github.com/yauthdev/yauth/server/enum" - "github.com/yauthdev/yauth/server/graph/model" - "github.com/yauthdev/yauth/server/session" - "github.com/yauthdev/yauth/server/utils" + "github.com/authorizerdev/authorizer/server/db" + "github.com/authorizerdev/authorizer/server/enum" + "github.com/authorizerdev/authorizer/server/graph/model" + "github.com/authorizerdev/authorizer/server/session" + "github.com/authorizerdev/authorizer/server/utils" ) func Token(ctx context.Context) (*model.LoginResponse, error) { diff --git a/server/resolvers/updateProfile.go b/server/resolvers/updateProfile.go index 99609af..1ff135c 100644 --- a/server/resolvers/updateProfile.go +++ b/server/resolvers/updateProfile.go @@ -7,11 +7,11 @@ import ( "strings" "time" - "github.com/yauthdev/yauth/server/db" - "github.com/yauthdev/yauth/server/enum" - "github.com/yauthdev/yauth/server/graph/model" - "github.com/yauthdev/yauth/server/session" - "github.com/yauthdev/yauth/server/utils" + "github.com/authorizerdev/authorizer/server/db" + "github.com/authorizerdev/authorizer/server/enum" + "github.com/authorizerdev/authorizer/server/graph/model" + "github.com/authorizerdev/authorizer/server/session" + "github.com/authorizerdev/authorizer/server/utils" "golang.org/x/crypto/bcrypt" ) diff --git a/server/resolvers/users.go b/server/resolvers/users.go index aaef1af..902676f 100644 --- a/server/resolvers/users.go +++ b/server/resolvers/users.go @@ -4,9 +4,9 @@ import ( "context" "fmt" - "github.com/yauthdev/yauth/server/db" - "github.com/yauthdev/yauth/server/graph/model" - "github.com/yauthdev/yauth/server/utils" + "github.com/authorizerdev/authorizer/server/db" + "github.com/authorizerdev/authorizer/server/graph/model" + "github.com/authorizerdev/authorizer/server/utils" ) func Users(ctx context.Context) ([]*model.User, error) { diff --git a/server/resolvers/verificationRequests.go b/server/resolvers/verificationRequests.go index 3ffb539..3509cfa 100644 --- a/server/resolvers/verificationRequests.go +++ b/server/resolvers/verificationRequests.go @@ -4,9 +4,9 @@ import ( "context" "fmt" - "github.com/yauthdev/yauth/server/db" - "github.com/yauthdev/yauth/server/graph/model" - "github.com/yauthdev/yauth/server/utils" + "github.com/authorizerdev/authorizer/server/db" + "github.com/authorizerdev/authorizer/server/graph/model" + "github.com/authorizerdev/authorizer/server/utils" ) func VerificationRequests(ctx context.Context) ([]*model.VerificationRequest, error) { diff --git a/server/resolvers/verifyEmail.go b/server/resolvers/verifyEmail.go index 978bf4f..8457b97 100644 --- a/server/resolvers/verifyEmail.go +++ b/server/resolvers/verifyEmail.go @@ -5,11 +5,11 @@ import ( "fmt" "time" - "github.com/yauthdev/yauth/server/db" - "github.com/yauthdev/yauth/server/enum" - "github.com/yauthdev/yauth/server/graph/model" - "github.com/yauthdev/yauth/server/session" - "github.com/yauthdev/yauth/server/utils" + "github.com/authorizerdev/authorizer/server/db" + "github.com/authorizerdev/authorizer/server/enum" + "github.com/authorizerdev/authorizer/server/graph/model" + "github.com/authorizerdev/authorizer/server/session" + "github.com/authorizerdev/authorizer/server/utils" ) func VerifyEmail(ctx context.Context, params model.VerifyEmailInput) (*model.LoginResponse, error) { diff --git a/server/server.go b/server/server.go index 25c3984..6f50b08 100644 --- a/server/server.go +++ b/server/server.go @@ -4,10 +4,10 @@ import ( "context" "log" + "github.com/authorizerdev/authorizer/server/enum" + "github.com/authorizerdev/authorizer/server/handlers" + "github.com/authorizerdev/authorizer/server/oauth" "github.com/gin-gonic/gin" - "github.com/yauthdev/yauth/server/enum" - "github.com/yauthdev/yauth/server/handlers" - "github.com/yauthdev/yauth/server/oauth" ) func GinContextToContextMiddleware() gin.HandlerFunc { diff --git a/server/session/session.go b/server/session/session.go index ec41965..5f135b4 100644 --- a/server/session/session.go +++ b/server/session/session.go @@ -4,8 +4,8 @@ import ( "context" "log" + "github.com/authorizerdev/authorizer/server/constants" "github.com/go-redis/redis/v8" - "github.com/yauthdev/yauth/server/constants" ) type SessionStore struct { diff --git a/server/utils/authToken.go b/server/utils/authToken.go index dc90b2d..736b8a7 100644 --- a/server/utils/authToken.go +++ b/server/utils/authToken.go @@ -6,10 +6,10 @@ import ( "strings" "time" + "github.com/authorizerdev/authorizer/server/constants" + "github.com/authorizerdev/authorizer/server/enum" "github.com/gin-gonic/gin" "github.com/golang-jwt/jwt" - "github.com/yauthdev/yauth/server/constants" - "github.com/yauthdev/yauth/server/enum" ) type UserAuthInfo struct { diff --git a/server/utils/cookie.go b/server/utils/cookie.go index ba45f8d..0cb23a1 100644 --- a/server/utils/cookie.go +++ b/server/utils/cookie.go @@ -5,8 +5,8 @@ import ( "net/http" "net/url" + "github.com/authorizerdev/authorizer/server/constants" "github.com/gin-gonic/gin" - "github.com/yauthdev/yauth/server/constants" ) func SetCookie(gc *gin.Context, token string) { diff --git a/server/utils/email.go b/server/utils/email.go index a73f059..13aabde 100644 --- a/server/utils/email.go +++ b/server/utils/email.go @@ -3,8 +3,8 @@ package utils import ( "fmt" - "github.com/yauthdev/yauth/server/constants" - "github.com/yauthdev/yauth/server/email" + "github.com/authorizerdev/authorizer/server/constants" + "github.com/authorizerdev/authorizer/server/email" ) // SendVerificationMail to send verification email diff --git a/server/utils/urls.go b/server/utils/urls.go index 2b87b2a..e249ea0 100644 --- a/server/utils/urls.go +++ b/server/utils/urls.go @@ -4,7 +4,7 @@ import ( "net/url" "strings" - "github.com/yauthdev/yauth/server/constants" + "github.com/authorizerdev/authorizer/server/constants" ) func GetDomainName() string { diff --git a/server/utils/validateSuperAdmin.go b/server/utils/validateSuperAdmin.go index db9a1cb..d92ba14 100644 --- a/server/utils/validateSuperAdmin.go +++ b/server/utils/validateSuperAdmin.go @@ -1,8 +1,8 @@ package utils import ( + "github.com/authorizerdev/authorizer/server/constants" "github.com/gin-gonic/gin" - "github.com/yauthdev/yauth/server/constants" ) func IsSuperAdmin(gc *gin.Context) bool { @@ -11,5 +11,5 @@ func IsSuperAdmin(gc *gin.Context) bool { return false } - return secret == constants.YAUTH_ADMIN_SECRET + return secret == constants.ROOT_SECRET } diff --git a/server/utils/verificationToken.go b/server/utils/verificationToken.go index 3b89a01..8445e16 100644 --- a/server/utils/verificationToken.go +++ b/server/utils/verificationToken.go @@ -3,8 +3,8 @@ package utils import ( "time" + "github.com/authorizerdev/authorizer/server/constants" "github.com/golang-jwt/jwt" - "github.com/yauthdev/yauth/server/constants" ) type UserInfo struct {