Skip to content

Commit

Permalink
fix: undefined IP in staging
Browse files Browse the repository at this point in the history
  • Loading branch information
conradbekondo committed Jan 14, 2025
1 parent 5597388 commit 1c083c4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion server/handlers/auth.mts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export function handleGoogleOauthCallback({ failureRedirect }: { failureRedirect
export async function handleUserSignIn(req: Request, res: Response) {
logger.info('signing in user');
logger.info('request headers', req.headers);
const ip = Netlify?.context?.ip ?? req.ip ?? String(req.header('client-ip'));
const ip = req.ip ?? String(req.header('client-ip'));

try {
const { success, data } = UserSchema.safeParse(req.user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,26 @@ <h2 class="font-semibold">MTN Mobile Money &trade; <i class="pi pi-question-circ
<p class="text-sm text-muted-color max-w-[300px]">Connect your MTN Mobile Money number. <strong>Not your
PIN</strong></p>
}@else {
<form (ngSubmit)="onFormSubmit()" [formGroup]="form" class="inline-flex gap-2 items-start">
<p-select formControlName="code" placeholder="Select Country" [filter]="true"
[filterFields]="['alpha2Code','alpha3Code','nativeName','name']" filterMatchMode="contains"
optionValue="alpha2Code" [options]="momoCountries()" appendTo="body" [virtualScroll]="true"
[virtualScrollItemSize]="38" [loading]="loadingMomoCountries()">
<ng-template #selectedItem let-item>
<div class="flex justify-between gap-1 items-center w-[3rem]">
<img [src]="item.flags.png" width="21" class="m-0" [alt]="item.nativeName">
<span>+{{ item.callingCodes[0] }}</span>
</div>
</ng-template>
<ng-template #item let-country>
<div class="flex items-center gap-2">
<img [src]="country.flags.svg" width="25" [alt]="country.nativeName">
<span>{{ country.nativeName }}</span>
</div>
</ng-template>
</p-select>
<form (ngSubmit)="onFormSubmit()" [formGroup]="form" class="inline-flex gap-2 items-start flex-wrap">
<div>
<p-select formControlName="code" placeholder="Select Country" [filter]="true"
[filterFields]="['alpha2Code','alpha3Code','nativeName','name']" filterMatchMode="contains"
optionValue="alpha2Code" [options]="momoCountries()" appendTo="body" [virtualScroll]="true"
[virtualScrollItemSize]="38" [loading]="loadingMomoCountries()">
<ng-template #selectedItem let-item>
<div class="flex justify-between gap-1 items-center w-[3rem]">
<img [src]="item.flags.png" width="21" class="m-0" [alt]="item.nativeName">
<span>+{{ item.callingCodes[0] }}</span>
</div>
</ng-template>
<ng-template #item let-country>
<div class="flex items-center gap-2">
<img [src]="country.flags.svg" width="25" [alt]="country.nativeName">
<span>{{ country.nativeName }}</span>
</div>
</ng-template>
</p-select>
</div>
<div class="space-y-1">
<p-input-group>
<input [placeholder]="samplePhoneNumber$ | async" [code]="form.value.code ?? undefined"
Expand Down

0 comments on commit 1c083c4

Please sign in to comment.