Skip to content

Commit

Permalink
Migrate authentication functionality in server (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximilianruesch authored Nov 21, 2023
1 parent b0a36f7 commit 3fbd87d
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions electron/providers/jira-server-provider/JiraServerProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,19 @@ export class JiraServerProvider implements IProvider {
}

getResource(): Promise<Resource> {
throw new Error("Method not implemented.")
return new Promise<Resource>((resolve, reject) => {
if (this.loginOptions.username !== undefined && this.loginOptions.password) {
// IMPROVE expose API client instead of resource
const {defaults} = this.getRestApiClient(2)
const result: Resource = {
baseUrl: defaults.baseURL ?? '',
authorization: defaults.headers.Authorization as string,
}
resolve(result)
} else {
reject()
}
})
}

createSprint(sprint: SprintCreate): Promise<void> {
Expand Down Expand Up @@ -681,10 +693,7 @@ export class JiraServerProvider implements IProvider {
throw new Error("Method not implemented for Jira Server")
}

refreshAccessToken(oauthRefreshOptions: {
clientId: string
clientSecret: string
}): Promise<void> {
refreshAccessToken(): Promise<void> {
throw new Error("Method not implemented for Jira Server")
}

Expand Down

0 comments on commit 3fbd87d

Please sign in to comment.