Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes using env var for login. Closes #6469 #6470

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/m365/commands/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ class LoginCommand extends Command {

public getRefinedSchema(schema: typeof options): z.ZodEffects<any> | undefined {
return schema
.refine(options => typeof options.appId !== 'undefined' || cli.getConfig().get(settingsNames.clientId), {
message: `appId is required. TIP: use the "m365 setup" command to configure the default appId`
.refine(options => typeof options.appId !== 'undefined' || cli.getClientId(), {
message: `appId is required. TIP: use the "m365 setup" command to configure the default appId`,
path: ['appId']
})
.refine(options => options.authType !== 'password' || options.userName, {
message: 'Username is required when using password authentication',
Expand Down