Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

only send createhome requests if the account has been migrated #63

Merged
merged 2 commits into from
Jul 10, 2020

Conversation

C0rby
Copy link
Contributor

@C0rby C0rby commented Jul 9, 2020

This change adds a check if an account has been migrated by getting it from the ocis-accounts service. If no account is returned it means it hasn't been migrated.

Closes #52

@C0rby C0rby requested review from butonic and refs July 9, 2020 11:57
@C0rby C0rby self-assigned this Jul 9, 2020
@C0rby C0rby force-pushed the feature/create-home-if-migrated branch 3 times, most recently from 55a1f6b to 8c75641 Compare July 9, 2020 12:24
@IljaN IljaN force-pushed the feature/create-home-if-migrated branch from 02f67f3 to 0b7930b Compare July 10, 2020 14:19
token := r.Header.Get("x-access-token")
if token == "" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to halt every other middleware if the token is not present? Or do we also need to call next.ServeHTTP(w, r) before return?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@IljaN IljaN requested review from refs and IljaN July 10, 2020 14:28
@IljaN IljaN force-pushed the feature/create-home-if-migrated branch 2 times, most recently from 7da5605 to 9097fcd Compare July 10, 2020 14:34
David Christofas and others added 2 commits July 10, 2020 16:37
@ownclouders
Copy link

Codacy Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- pkg/middleware/create_home.go  5
         

See the complete overview on Codacy

@IljaN IljaN merged commit 94ea9ed into master Jul 10, 2020
@delete-merged-branch delete-merged-branch bot deleted the feature/create-home-if-migrated branch July 10, 2020 14:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

do not send create home request if user has not yet been migrated
4 participants