Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored May 27, 2024
1 parent 237343f commit 7b9bd0f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ee/tabby-schema/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ type Mutation {
updateUserRole(id: ID!, isAdmin: Boolean!): Boolean!
uploadUserAvatarBase64(id: ID!, avatarBase64: String): Boolean!
updateUserName(id: ID!, name: String!): Boolean!
register(name: String!, email: String!, password1: String!, password2: String!, invitationCode: String): RegisterResponse!
register(email: String!, password1: String!, password2: String!, invitationCode: String, name: String!): RegisterResponse!
tokenAuth(email: String!, password: String!): TokenAuthResponse!
verifyToken(token: String!): Boolean!
refreshToken(refreshToken: String!): RefreshTokenResponse!
Expand Down
2 changes: 1 addition & 1 deletion ee/tabby-schema/src/schema/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ pub trait AuthenticationService: Send + Sync {
email: String,
password1: String,
invitation_code: Option<String>,
name: Option<String>
name: Option<String>,
) -> Result<RegisterResponse>;
async fn allow_self_signup(&self) -> Result<bool>;

Expand Down
2 changes: 1 addition & 1 deletion ee/tabby-schema/src/schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ impl Mutation {
password1: String,
password2: String,
invitation_code: Option<String>,
name: String
name: String,

Check warning on line 837 in ee/tabby-schema/src/schema/mod.rs

View check run for this annotation

Codecov / codecov/patch

ee/tabby-schema/src/schema/mod.rs#L837

Added line #L837 was not covered by tests
) -> Result<RegisterResponse> {
let input = auth::RegisterInput {
email,
Expand Down
16 changes: 13 additions & 3 deletions ee/tabby-webserver/src/service/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl AuthenticationService for AuthenticationServiceImpl {
email: String,
password: String,
invitation_code: Option<String>,
name: Option<String>
name: Option<String>,
) -> Result<RegisterResponse> {
let is_admin_initialized = self.is_admin_initialized().await?;
if is_admin_initialized && is_demo_mode() {
Expand Down Expand Up @@ -91,7 +91,12 @@ impl AuthenticationService for AuthenticationServiceImpl {
.await?
} else {
self.db
.create_user(email.clone(), Some(pwd_hash), !is_admin_initialized, name.clone())
.create_user(
email.clone(),
Some(pwd_hash),
!is_admin_initialized,
name.clone(),
)
.await?
};

Expand Down Expand Up @@ -737,7 +742,12 @@ mod tests {

async fn register_admin_user(service: &AuthenticationServiceImpl) -> RegisterResponse {
service
.register(ADMIN_EMAIL.to_owned(), ADMIN_PASSWORD.to_owned(), None, None)
.register(
ADMIN_EMAIL.to_owned(),
ADMIN_PASSWORD.to_owned(),
None,
None,
)
.await
.unwrap()
}
Expand Down

0 comments on commit 7b9bd0f

Please sign in to comment.